本文整理汇总了C#中NoSpecimen类的典型用法代码示例。如果您正苦于以下问题:C# NoSpecimen类的具体用法?C# NoSpecimen怎么用?C# NoSpecimen使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
NoSpecimen类属于命名空间,在下文中一共展示了NoSpecimen类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateWithInvalidRequestReturnsNoSpecimen
public static IEnumerable<ITestCase> CreateWithInvalidRequestReturnsNoSpecimen()
{
var invalidRequests = new[]
{
null,
new object(),
string.Empty,
123,
typeof(int),
typeof(object[]),
typeof(string[][])
};
return invalidRequests.Select(r => new TestCase(() =>
{
var sut = new MultidimensionalArrayRelay();
var dummyContext = new DelegatingSpecimenContext();
#pragma warning disable 618
var expected = new NoSpecimen(r);
#pragma warning restore 618
var actual = sut.Create(r, dummyContext);
Assert.Equal(expected, actual);
}));
}
示例2: SutIsEquatable
public void SutIsEquatable()
{
// Fixture setup
// Exercise system
var sut = new NoSpecimen();
// Verify outcome
Assert.IsAssignableFrom<IEquatable<NoSpecimen>>(sut);
// Teardown
}
示例3: CreateWithNullRequestWillSetCorrectRequest
public void CreateWithNullRequestWillSetCorrectRequest()
{
// Fixture setup
// Exercise system
var sut = new NoSpecimen(null);
// Verify outcome
Assert.Null(sut.Request);
// Teardown
}
示例4: DefaultConstructorWillSetRequestToNull
public void DefaultConstructorWillSetRequestToNull()
{
// Fixture setup
var sut = new NoSpecimen();
// Exercise system
var result = sut.Request;
// Verify outcome
Assert.Null(result);
// Teardown
}
示例5: SutDoesNotEqualNullSut
public void SutDoesNotEqualNullSut()
{
// Fixture setup
var sut = new NoSpecimen();
NoSpecimen other = null;
// Exercise system
var result = sut.Equals(other);
// Verify outcome
Assert.False(result, "Equals");
// Teardown
}
示例6: CreateWithNullRequestWillSetCorrectRequest
public void CreateWithNullRequestWillSetCorrectRequest()
{
// Fixture setup
// Exercise system
#pragma warning disable 618
var sut = new NoSpecimen(null);
// Verify outcome
Assert.Null(sut.Request);
#pragma warning restore 618
// Teardown
}
示例7: SutDoesNotEqualAnonymousObject
public void SutDoesNotEqualAnonymousObject()
{
// Fixture setup
var sut = new NoSpecimen();
var anonymousObject = new object();
// Exercise system
var result = sut.Equals(anonymousObject);
// Verify outcome
Assert.False(result, "Equals");
// Teardown
}
示例8: RequestWillMatchContructorArgument
public void RequestWillMatchContructorArgument()
{
// Fixture setup
var expectedRequest = new object();
var sut = new NoSpecimen(expectedRequest);
// Exercise system
var result = sut.Request;
// Verify outcome
Assert.Equal(expectedRequest, result);
// Teardown
}
示例9: DefaultConstructorWillSetRequestToNull
public void DefaultConstructorWillSetRequestToNull()
{
// Fixture setup
var sut = new NoSpecimen();
// Exercise system
#pragma warning disable 618
var result = sut.Request;
#pragma warning restore 618
// Verify outcome
Assert.Null(result);
// Teardown
}
示例10: CreateWithNoneEnumerableRequestReturnsCorrectResult
public void CreateWithNoneEnumerableRequestReturnsCorrectResult(object request)
{
// Fixture setup
var sut = new EnumerableRelay();
// Exercise system
var dummyContext = new DelegatingSpecimenContext { OnResolve = r => Enumerable.Empty<object>() };
var result = sut.Create(request, dummyContext);
// Verify outcome
var expectedResult = new NoSpecimen(request);
Assert.Equal(expectedResult, result);
// Teardown
}
示例11: CreateNonTypeReturnsCorrectResult
public void CreateNonTypeReturnsCorrectResult(object request)
{
// Fixture setup
var sut = new TypeGenerator();
// Exercise system
var dummyContext = new DelegatingSpecimenContext();
var result = sut.Create(request, dummyContext);
// Verify outcome
var expected = new NoSpecimen(request);
Assert.Equal(expected, result);
// Teardown
}
示例12: AnythingElseThanAnIntPtrRequestReturnsCorrectResult
public void AnythingElseThanAnIntPtrRequestReturnsCorrectResult(object request)
{
// Fixture setup
var sut = new IntPtrGuard();
// Exercise system
var dummyContext = new DelegatingSpecimenContext();
var result = sut.Create(request, dummyContext);
// Verify outcome
var expectedResult = new NoSpecimen(request);
Assert.Equal(expectedResult, result);
// Teardown
}
示例13: CreateWithNonNumericTypeRequestReturnsNoSpecimen
public void CreateWithNonNumericTypeRequestReturnsNoSpecimen(Type request)
{
// Fixture setup
var sut = new NumericSequenceGenerator();
// Exercise system
var dummyContainer = new DelegatingSpecimenContext();
var result = sut.Create(request, dummyContainer);
// Verify outcome
var expectedResult = new NoSpecimen(request);
Assert.Equal(expectedResult, result);
// Teardown
}
示例14: CreateWithNoneArrayRequestReturnsCorrectResult
public void CreateWithNoneArrayRequestReturnsCorrectResult(object request)
{
// Fixture setup
var sut = new ArrayRelay();
// Exercise system
var dummyContext = new DelegatingSpecimenContext();
var result = sut.Create(request, dummyContext);
// Verify outcome
var expectedResult = new NoSpecimen(request);
Assert.Equal(expectedResult, result);
// Teardown
}
示例15: CreateFromNullRequestWillReturnCorrectResult
public void CreateFromNullRequestWillReturnCorrectResult()
{
// Fixture setup
var sut = new StringGenerator(() => new object());
// Exercise system
var dummyContainer = new DelegatingSpecimenContext();
var result = sut.Create(null, dummyContainer);
// Verify outcome
var expectedResult = new NoSpecimen();
Assert.Equal(expectedResult, result);
// Teardown
}