本文整理汇总了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
}
示例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
}
示例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
}
示例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
}
示例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
}
示例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
}
示例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
}
示例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
}
示例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
}
示例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
}
示例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
}
示例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
}
示例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
}
示例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
}
示例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
}