public Compose ( IEnumerable |
||
builders | IEnumerable |
The builders to compose. |
return | ISpecimenBuilderNode |
public void ComposeSingleItemReturnsCorrectResult() { // Fixture setup var dummyBuilder = new DelegatingSpecimenBuilder(); var sut = new ThrowingRecursionGuard(dummyBuilder); // Exercise system var expected = new DelegatingSpecimenBuilder(); var actual = sut.Compose(new[] { expected }); // Verify outcome var rg = Assert.IsAssignableFrom<ThrowingRecursionGuard>(actual); Assert.Equal(expected, rg.Builder); // Teardown }
public void ComposeReturnsCorrectResult() { // Fixture setup var dummyBuilder = new DelegatingSpecimenBuilder(); var sut = new ThrowingRecursionGuard(dummyBuilder); // Exercise system var expectedBuilders = new[] { new DelegatingSpecimenBuilder(), new DelegatingSpecimenBuilder(), new DelegatingSpecimenBuilder() }; var actual = sut.Compose(expectedBuilders); // Verify outcome var rg = Assert.IsAssignableFrom<ThrowingRecursionGuard>(actual); var composite = Assert.IsAssignableFrom<CompositeSpecimenBuilder>(rg.Builder); Assert.True(expectedBuilders.SequenceEqual(composite)); // Teardown }
public void ComposeRetainsComparer() { // Fixture setup var dummyBuilder = new DelegatingSpecimenBuilder(); var expected = new DelegatingEqualityComparer(); var sut = new ThrowingRecursionGuard(dummyBuilder, expected); // Exercise system var actual = sut.Compose(new ISpecimenBuilder[0]); // Verify outcome var rg = Assert.IsAssignableFrom<ThrowingRecursionGuard>(actual); Assert.Equal(expected, rg.Comparer); // Teardown }