public void WithoutReturnsCorrectResult() { // Fixture setup var node = new CompositeSpecimenBuilder( new DelegatingSpecimenBuilder(), SpecimenBuilderNodeFactory.CreateComposer <FieldHolder <short> >(), SpecimenBuilderNodeFactory.CreateComposer <PropertyHolder <int> >(), SpecimenBuilderNodeFactory.CreateComposer <FieldHolder <short> >(), new DelegatingSpecimenBuilder()); var sut = new CompositeNodeComposer <FieldHolder <short> >(node); // Exercise system var actual = sut.Without(x => x.Field); // Verify outcome var expected = new CompositeNodeComposer <FieldHolder <short> >( new CompositeSpecimenBuilder( new DelegatingSpecimenBuilder(), (ISpecimenBuilder)SpecimenBuilderNodeFactory.CreateComposer <FieldHolder <short> >().Without(x => x.Field), SpecimenBuilderNodeFactory.CreateComposer <PropertyHolder <int> >(), (ISpecimenBuilder)SpecimenBuilderNodeFactory.CreateComposer <FieldHolder <short> >().Without(x => x.Field), new DelegatingSpecimenBuilder())); var n = Assert.IsAssignableFrom <ISpecimenBuilderNode>(actual); Assert.True(expected.GraphEquals(n, new NodeComparer())); // Teardown }
public void WithoutReturnsCorrectResult() { // Fixture setup var node = new CompositeSpecimenBuilder( new DelegatingSpecimenBuilder(), SpecimenBuilderNodeFactory.CreateComposer<FieldHolder<short>>(), SpecimenBuilderNodeFactory.CreateComposer<PropertyHolder<int>>(), SpecimenBuilderNodeFactory.CreateComposer<FieldHolder<short>>(), new DelegatingSpecimenBuilder()); var sut = new CompositeNodeComposer<FieldHolder<short>>(node); // Exercise system var actual = sut.Without(x => x.Field); // Verify outcome var expected = new CompositeNodeComposer<FieldHolder<short>>( new CompositeSpecimenBuilder( new DelegatingSpecimenBuilder(), (ISpecimenBuilder)SpecimenBuilderNodeFactory.CreateComposer<FieldHolder<short>>().Without(x => x.Field), SpecimenBuilderNodeFactory.CreateComposer<PropertyHolder<int>>(), (ISpecimenBuilder)SpecimenBuilderNodeFactory.CreateComposer<FieldHolder<short>>().Without(x => x.Field), new DelegatingSpecimenBuilder())); var n = Assert.IsAssignableFrom<ISpecimenBuilderNode>(actual); Assert.True(expected.GraphEquals(n, new NodeComparer())); // Teardown }