当前位置: 首页>>代码示例>>C#>>正文


C# NoSpecimen类代码示例

本文整理汇总了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);
            }));
        }
开发者ID:RyanLiu99,项目名称:AutoFixture,代码行数:25,代码来源:MultidimensionalArrayRelayTest.cs

示例2: SutIsEquatable

 public void SutIsEquatable()
 {
     // Fixture setup
     // Exercise system
     var sut = new NoSpecimen();
     // Verify outcome
     Assert.IsAssignableFrom<IEquatable<NoSpecimen>>(sut);
     // Teardown
 }
开发者ID:RyanLiu99,项目名称:AutoFixture,代码行数:9,代码来源:NoSpecimenTest.cs

示例3: CreateWithNullRequestWillSetCorrectRequest

 public void CreateWithNullRequestWillSetCorrectRequest()
 {
     // Fixture setup
     // Exercise system
     var sut = new NoSpecimen(null);
     // Verify outcome
     Assert.Null(sut.Request);
     // Teardown
 }
开发者ID:rajeshgupthar,项目名称:AutoFixture,代码行数:9,代码来源:NoSpecimenTest.cs

示例4: DefaultConstructorWillSetRequestToNull

 public void DefaultConstructorWillSetRequestToNull()
 {
     // Fixture setup
     var sut = new NoSpecimen();
     // Exercise system
     var result = sut.Request;
     // Verify outcome
     Assert.Null(result);
     // Teardown
 }
开发者ID:rajeshgupthar,项目名称:AutoFixture,代码行数:10,代码来源:NoSpecimenTest.cs

示例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
 }
开发者ID:RyanLiu99,项目名称:AutoFixture,代码行数:11,代码来源:NoSpecimenTest.cs

示例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
        }
开发者ID:RyanLiu99,项目名称:AutoFixture,代码行数:11,代码来源:NoSpecimenTest.cs

示例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
 }
开发者ID:rajeshgupthar,项目名称:AutoFixture,代码行数:11,代码来源:NoSpecimenTest.cs

示例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
 }
开发者ID:rajeshgupthar,项目名称:AutoFixture,代码行数:11,代码来源:NoSpecimenTest.cs

示例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
        }
开发者ID:RyanLiu99,项目名称:AutoFixture,代码行数:12,代码来源:NoSpecimenTest.cs

示例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
 }
开发者ID:keithbloom,项目名称:AutoFixture,代码行数:12,代码来源:EnumerableRelayTest.cs

示例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
 }
开发者ID:jpierson,项目名称:AutoFixture,代码行数:12,代码来源:TypeGeneratorTest.cs

示例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
 }
开发者ID:nrjohnstone,项目名称:AutoFixture,代码行数:12,代码来源:IntPtrGuardTest.cs

示例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
 }
开发者ID:jpierson,项目名称:AutoFixture,代码行数:12,代码来源:NumericSequenceGeneratorTest.cs

示例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
 }
开发者ID:nrjohnstone,项目名称:AutoFixture,代码行数:12,代码来源:ArrayRelayTest.cs

示例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
 }
开发者ID:RyanLiu99,项目名称:AutoFixture,代码行数:12,代码来源:StringGeneratorTest.cs


注:本文中的NoSpecimen类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。