public void ReturnAProductWithAPartTwo_WhenBuildIsCalled()
        {
            var expectedProduct = new Product();

            expectedProduct.Add("Part D");

            var concreteBuilderCd = new ConcreteBuilderCd();

            concreteBuilderCd.IncludePartTwo();
            var actual = concreteBuilderCd.Build();

            actual.Should().BeEquivalentTo(expectedProduct);
        }
Пример #2
0
        public void ConstructABuilderWithPartOneAndTwo_WhenConstructIsCalledWithConcreteBuilderCd()
        {
            var expectedBuilder = new ConcreteBuilderCd();

            expectedBuilder.IncludePartOne();
            expectedBuilder.IncludePartTwo();

            var director = new Director();
            var builder  = new ConcreteBuilderCd();

            director.Construct(builder);

            builder.Should().BeEquivalentTo(expectedBuilder);
        }