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


C# DelegatingSpecimenBuilder类代码示例

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


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

示例1: InitializeWithNullEqualityComparerThrows

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

示例2: IndexOfReturnsCorrectResultWhenItemIsNotInNode

 public void IndexOfReturnsCorrectResultWhenItemIsNotInNode()
 {
     // Fixture setup
     var item = new DelegatingSpecimenBuilder();
     // Exercise system
     var actual = this.sut.IndexOf(item);
     // Verify outcome
     Assert.Equal(-1, actual);
     // Teardown
 }
开发者ID:ptrelford,项目名称:AutoFixture,代码行数:10,代码来源:SpecimenBuilderNodeAdapterCollectionTest.cs

示例3: SutIsNode

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

示例4: TransformReturnsCorrectResult

 public void TransformReturnsCorrectResult()
 {
     // Fixture setup
     var sut = new ThrowingRecursionBehavior();
     // Exercise system
     var dummyBuilder = new DelegatingSpecimenBuilder();
     var result = sut.Transform(dummyBuilder);
     // Verify outcome
     Assert.IsAssignableFrom<ThrowingRecursionGuard>(result);
     // Teardown
 }
开发者ID:rajeshgupthar,项目名称:AutoFixture,代码行数:11,代码来源:ThrowingRecursionBehaviorTest.cs

示例5: InsertsCorrectlyInsertsItem

 public void InsertsCorrectlyInsertsItem(int expected)
 {
     // Fixture setup
     var item = new DelegatingSpecimenBuilder();
     // Exercise system
     this.sut.Insert(expected, item);
     // Verify outcome
     var actual = this.sut.IndexOf(item);
     Assert.Equal(expected, actual);
     // Teardown
 }
开发者ID:ptrelford,项目名称:AutoFixture,代码行数:11,代码来源:SpecimenBuilderNodeAdapterCollectionTest.cs

示例6: SutYieldsInjectedBuilder

 public void SutYieldsInjectedBuilder()
 {
     // Fixture setup
     var expected = new DelegatingSpecimenBuilder();
     var sut = new DelegatingRecursionGuard(expected);
     // Exercise system
     // Verify outcome
     Assert.Equal(expected, sut.Single());
     Assert.Equal(expected, ((System.Collections.IEnumerable)sut).Cast<object>().Single());
     // Teardown
 }
开发者ID:robertlyson,项目名称:AutoFixture,代码行数:11,代码来源:RecursionGuardTest.cs

示例7: AddAddsItemToEndOfNode

 public void AddAddsItemToEndOfNode()
 {
     // Fixture setup
     var item = new DelegatingSpecimenBuilder();
     var expected = this.FindMarkedNode().Concat(new[] { item });
     // Exercise system
     this.sut.Add(item);
     // Verify outcome
     Assert.True(expected.SequenceEqual(this.sut));
     // Teardown
 }
开发者ID:dhilgarth,项目名称:AutoFixture,代码行数:11,代码来源:SpecimenBuilderNodeAdapterCollectionTest.cs

示例8: TransformResultCorrectlyDecoratesInput

 public void TransformResultCorrectlyDecoratesInput()
 {
     // Fixture setup
     var sut = new OmitOnRecursionBehavior();
     var expectedBuilder = new DelegatingSpecimenBuilder();
     // Exercise system
     var result = sut.Transform(expectedBuilder);
     // Verify outcome
     var guard = Assert.IsAssignableFrom<RecursionGuard>(result);
     Assert.Equal(expectedBuilder, guard.Builder);
     // Teardown
 }
开发者ID:nrjohnstone,项目名称:AutoFixture,代码行数:12,代码来源:OmitOnRecursionBehaviorTest.cs

示例9: TransformReturnsCorrectResult

 public void TransformReturnsCorrectResult()
 {
     // Fixture setup
     var sut = new TracingBehavior();
     var builder = new DelegatingSpecimenBuilder();
     // Exercise system
     var result = sut.Transform(builder);
     // Verify outcome
     var tw = Assert.IsAssignableFrom<TraceWriter>(result);
     Assert.Equal(builder, tw.Tracer.Builder);
     // Teardown
 }
开发者ID:RyanLiu99,项目名称:AutoFixture,代码行数:12,代码来源:TracingBehaviorTest.cs

示例10: AddRaisesGraphChanged

 public void AddRaisesGraphChanged()
 {
     // Fixture setup
     var verified = false;
     this.sut.GraphChanged += (s, e) => verified = s != null && e != null;
     // Exercise system
     var dummyItem = new DelegatingSpecimenBuilder();
     this.sut.Add(dummyItem);
     // Verify outcome
     Assert.True(verified);
     // Teardown
 }
开发者ID:dhilgarth,项目名称:AutoFixture,代码行数:12,代码来源:SpecimenBuilderNodeAdapterCollectionTest.cs

示例11: ComparerIsCorrect

 public void ComparerIsCorrect()
 {
     // Fixture setup
     var dummyBuilder = new DelegatingSpecimenBuilder();
     var expected = new DelegatingEqualityComparer();
     var sut = new DelegatingRecursionGuard(dummyBuilder, expected);
     // Exercise system
     IEqualityComparer actual = sut.Comparer;
     // Verify outcome
     Assert.Equal(expected, actual);
     // Teardown
 }
开发者ID:robertlyson,项目名称:AutoFixture,代码行数:12,代码来源:RecursionGuardTest.cs

示例12: TransformReturnsCorrectResultForDefaultRecursionDepth

 public void TransformReturnsCorrectResultForDefaultRecursionDepth()
 {
     // Fixture setup
     var sut = new OmitOnRecursionBehavior();
     // Exercise system
     var dummyBuilder = new DelegatingSpecimenBuilder();
     var result = sut.Transform(dummyBuilder);
     // Verify outcome
     var rg = Assert.IsAssignableFrom<RecursionGuard>(result);
     Assert.IsAssignableFrom<OmitOnRecursionHandler>(rg.RecursionHandler);
     Assert.Equal(1, rg.RecursionDepth);
     // Teardown
 }
开发者ID:nrjohnstone,项目名称:AutoFixture,代码行数:13,代码来源:OmitOnRecursionBehaviorTest.cs

示例13: ComposeRetainsHandler

 public void ComposeRetainsHandler()
 {
     // Fixture setup
     var dummyBuilder = new DelegatingSpecimenBuilder();
     var expected = new DelegatingRecursionHandler();
     var dummyComparer = new DelegatingEqualityComparer();
     var sut = new RecursionGuard(dummyBuilder, expected, dummyComparer);
     // Exercise system
     var actual = sut.Compose(new ISpecimenBuilder[0]);
     // Verify outcome
     var rg = Assert.IsAssignableFrom<RecursionGuard>(actual);
     Assert.Equal(expected, rg.RecursionHandler);
     // Teardown
 }
开发者ID:dhilgarth,项目名称:AutoFixture,代码行数:14,代码来源:RecursionGuardTest.cs

示例14: TransformReturnsCorrectResultForSpecificRecursionDepth

 public void TransformReturnsCorrectResultForSpecificRecursionDepth()
 {
     // Fixture setup
     const int explicitRecursionDepth = 2;
     var sut = new NullRecursionBehavior(explicitRecursionDepth);
     // Exercise system
     var dummyBuilder = new DelegatingSpecimenBuilder();
     var result = sut.Transform(dummyBuilder);
     // Verify outcome
     var rg = Assert.IsAssignableFrom<RecursionGuard>(result);
     Assert.IsAssignableFrom<NullRecursionHandler>(rg.RecursionHandler);
     Assert.Equal(explicitRecursionDepth, rg.RecursionDepth);
     // Teardown
 }
开发者ID:TeaDrivenDev,项目名称:AutoFixture,代码行数:14,代码来源:NullRecursionBehaviorTest.cs

示例15: SingleParameterDoWillInvokeMethodWithCorrectParameter

        public void SingleParameterDoWillInvokeMethodWithCorrectParameter(
            int expected)
        {
            // Fixture setup
            var builder = new DelegatingSpecimenBuilder();
            builder.OnCreate = (r, c) => expected;

            var verified = false;
            var mock = new CommandMock<int>();
            mock.OnCommand = x => verified = expected == x;
            // Exercise system
            builder.Do((int i) => mock.Command(i));
            // Verify outcome
            Assert.True(verified, "Mock wasn't verified.");
            // Teardown
        }
开发者ID:ptrelford,项目名称:AutoFixture,代码行数:16,代码来源:SpecimenCommandTests.cs


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