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


C# Kernel.DelegatingSpecimenBuilder类代码示例

本文整理汇总了C#中Ploeh.AutoFixtureUnitTest.Kernel.DelegatingSpecimenBuilder的典型用法代码示例。如果您正苦于以下问题:C# DelegatingSpecimenBuilder类的具体用法?C# DelegatingSpecimenBuilder怎么用?C# DelegatingSpecimenBuilder使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


DelegatingSpecimenBuilder类属于Ploeh.AutoFixtureUnitTest.Kernel命名空间,在下文中一共展示了DelegatingSpecimenBuilder类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ComposeReturnsCorrectResult

        public void ComposeReturnsCorrectResult()
        {
            // Fixture setup
            var targetType = typeof(string);
            var factory = new DelegatingSpecimenBuilder();
            var sut = new TypedBuilderComposer(targetType, factory);
            // Exercise system
            var result = sut.Compose();
            // Verify outcome
            var filter = Assert.IsAssignableFrom<FilteringSpecimenBuilder>(result);

            var orSpec = Assert.IsAssignableFrom<OrRequestSpecification>(filter.Specification);
            Assert.Equal(targetType, orSpec.Specifications.OfType<SeedRequestSpecification>().Single().TargetType);
            Assert.Equal(targetType, orSpec.Specifications.OfType<ExactTypeSpecification>().Single().TargetType);

            var composite = Assert.IsAssignableFrom<CompositeSpecimenBuilder>(filter.Builder);
            var outputGuard = Assert.IsAssignableFrom<NoSpecimenOutputGuard>(composite.Builders.First());
            Assert.IsAssignableFrom<SeedIgnoringRelay>(composite.Builders.Last());

            Assert.Equal(factory, outputGuard.Builder);

            var inverseSpec = Assert.IsAssignableFrom<InverseRequestSpecification>(outputGuard.Specification);
            var seedSpec = Assert.IsAssignableFrom<SeedRequestSpecification>(inverseSpec.Specification);
            Assert.Equal(targetType, seedSpec.TargetType);
            // Teardown
        }
开发者ID:rajeshgupthar,项目名称:AutoFixture,代码行数:26,代码来源:TypedBuilderComposerTest.cs

示例2: CreateTypedNodeReturnsCorrectResult

        public void CreateTypedNodeReturnsCorrectResult(Type targetType)
        {
            // Fixture setup
            var factory = new DelegatingSpecimenBuilder();
            // Exercise system
            FilteringSpecimenBuilder actual =
                SpecimenBuilderNodeFactory.CreateTypedNode(
                    targetType,
                    factory);
            // Verify outcome
            var expected = new FilteringSpecimenBuilder(
                new CompositeSpecimenBuilder(
                    new NoSpecimenOutputGuard(
                        factory,
                        new InverseRequestSpecification(
                            new SeedRequestSpecification(
                                targetType))),
                    new SeedIgnoringRelay()),
                new OrRequestSpecification(
                    new SeedRequestSpecification(targetType),
                    new ExactTypeSpecification(targetType)));

            Assert.True(expected.GraphEquals(actual, new NodeComparer()));
            // Teardown
        }
开发者ID:RyanLiu99,项目名称:AutoFixture,代码行数:25,代码来源:SpecimenBuilderNodeFactoryTests.cs

示例3: InitializeDoubleActionWithNullActionThrows

 public void InitializeDoubleActionWithNullActionThrows()
 {
     // Fixture setup
     var dummyBuilder = new DelegatingSpecimenBuilder();
     // Exercise system and verify outcome
     Assert.Throws<ArgumentNullException>(() => new Postprocessor<string>(dummyBuilder, (Action<string, ISpecimenContext>)null));
     // Teardown
 }
开发者ID:RyanLiu99,项目名称:AutoFixture,代码行数:8,代码来源:PostprocessorGenericTest.cs

示例4: InitializeWithNullSpecificationWillThrow

 public void InitializeWithNullSpecificationWillThrow()
 {
     // Fixture setup
     var dummyBuilder = new DelegatingSpecimenBuilder();
     // Exercise system and verify outcome
     Assert.Throws<ArgumentNullException>(() => new FilteringSpecimenBuilder(dummyBuilder, null));
     // Teardown
 }
开发者ID:RyanLiu99,项目名称:AutoFixture,代码行数:8,代码来源:FilteringSpecimenBuilderTest.cs

示例5: ConstructorThrowsOnNullComparer

 public void ConstructorThrowsOnNullComparer()
 {
     // Fixture setup
     var dummy = new DelegatingSpecimenBuilder();
     // Exercise system and verify outcome
     Assert.Throws<ArgumentNullException>(() =>
         new OmitOnRecursionGuard(dummy, null));
     // Teardown
 }
开发者ID:rajeshgupthar,项目名称:AutoFixture,代码行数:9,代码来源:OmitOnRecursionGuardTest.cs

示例6: InitializeWithNullSpecificationThrows

 public void InitializeWithNullSpecificationThrows()
 {
     // Fixture setup
     var dummyBuilder = new DelegatingSpecimenBuilder();
     Action<object, ISpecimenContext> dummyAction = (s, c) => { };
     // Exercise system and verify outcome
     Assert.Throws<ArgumentNullException>(() => new Postprocessor(dummyBuilder, dummyAction, null));
     // Teardown
 }
开发者ID:rajeshgupthar,项目名称:AutoFixture,代码行数:9,代码来源:PostprocessorTest.cs

示例7: SutCanBeInitializedWithDoubleAction

 public void SutCanBeInitializedWithDoubleAction()
 {
     // Fixture setup
     var dummyBuilder = new DelegatingSpecimenBuilder();
     Action<object, ISpecimenContext> dummyAction = (s, c) => { };
     // Exercise system and verify outcome
     Assert.DoesNotThrow(() => new Postprocessor(dummyBuilder, dummyAction));
     // Teardown
 }
开发者ID:rajeshgupthar,项目名称:AutoFixture,代码行数:9,代码来源:PostprocessorTest.cs

示例8: InitializeGreedyCtorWithNullSpecificationThrows

 public void InitializeGreedyCtorWithNullSpecificationThrows()
 {
     // Fixture setup
     var dummyBuilder = new DelegatingSpecimenBuilder();
     // Exercise system and verify outcome
     Assert.Throws<ArgumentNullException>(() =>
         new NoSpecimenOutputGuard(dummyBuilder, null));
     // Teardown
 }
开发者ID:rajeshgupthar,项目名称:AutoFixture,代码行数:9,代码来源:NoSpecimenOutputGuardTest.cs

示例9: InitializeWithNullTypeThrows

 public void InitializeWithNullTypeThrows()
 {
     // Fixture setup
     var dummyBuilder = new DelegatingSpecimenBuilder();
     // Exercise system and verify outcome
     Assert.Throws<ArgumentNullException>(() =>
         new TypedBuilderComposer(null, dummyBuilder));
     // Teardown
 }
开发者ID:rajeshgupthar,项目名称:AutoFixture,代码行数:9,代码来源:TypedBuilderComposerTest.cs

示例10: SutIsSpecimenBuilder

 public void SutIsSpecimenBuilder()
 {
     // Fixture setup
     var dummyBuilder = new DelegatingSpecimenBuilder();
     // Exercise system
     var sut = new DisposableTracker(dummyBuilder);
     // Verify outcome
     Assert.IsAssignableFrom<ISpecimenBuilder>(sut);
     // Teardown
 }
开发者ID:rajeshgupthar,项目名称:AutoFixture,代码行数:10,代码来源:DisposableTrackerTest.cs

示例11: SutIsRecursionGuard

 public void SutIsRecursionGuard()
 {
     // Fixture setup
     // Exercise system
     var dummy = new DelegatingSpecimenBuilder();
     var sut = new OmitOnRecursionGuard(dummy);
     // Verify outcome
     Assert.IsAssignableFrom<RecursionGuard>(sut);
     // Teardown
 }
开发者ID:rajeshgupthar,项目名称:AutoFixture,代码行数:10,代码来源:OmitOnRecursionGuardTest.cs

示例12: SutIsSpecimenBuilderComposer

 public void SutIsSpecimenBuilderComposer()
 {
     // Fixture setup
     var dummyType = typeof(object);
     var dummyBuilder = new DelegatingSpecimenBuilder();
     // Exercise system
     var sut = new TypedBuilderComposer(dummyType, dummyBuilder);
     // Verify outcome
     Assert.IsAssignableFrom<ISpecimenBuilderComposer>(sut);
     // Teardown
 }
开发者ID:rajeshgupthar,项目名称:AutoFixture,代码行数:11,代码来源:TypedBuilderComposerTest.cs

示例13: SutIsSpecimenBuilder

 public void SutIsSpecimenBuilder()
 {
     // Fixture setup
     var dummySpecification = new DelegatingRequestSpecification();
     var dummyBuilder = new DelegatingSpecimenBuilder();
     // Exercise system
     var sut = new FilteringSpecimenBuilder(dummyBuilder, dummySpecification);
     // Verify outcome
     Assert.IsAssignableFrom<ISpecimenBuilder>(sut);
     // Teardown
 }
开发者ID:RyanLiu99,项目名称:AutoFixture,代码行数:11,代码来源:FilteringSpecimenBuilderTest.cs

示例14: SutIsNode

 public void SutIsNode()
 {
     // Fixture setup
     var dummyBuilder = new DelegatingSpecimenBuilder();
     var dummyCommand = new DelegatingSpecimenCommand();
     // Exercise system
     var sut = new Postprocessor<Version>(dummyBuilder, dummyCommand);
     // Verify outcome
     Assert.IsAssignableFrom<ISpecimenBuilderNode>(sut);
     // Teardown
 }
开发者ID:RyanLiu99,项目名称:AutoFixture,代码行数:11,代码来源:PostprocessorGenericTest.cs

示例15: SutIsSpecimenBuilder

 public void SutIsSpecimenBuilder()
 {
     // Fixture setup
     var dummyBuilder = new DelegatingSpecimenBuilder();
     Action<object> dummyAction = s => { };
     // Exercise system
     var sut = new Postprocessor(dummyBuilder, dummyAction);
     // Verify outcome
     Assert.IsAssignableFrom<ISpecimenBuilder>(sut);
     // Teardown
 }
开发者ID:rajeshgupthar,项目名称:AutoFixture,代码行数:11,代码来源:PostprocessorTest.cs


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