public void BuilderHasTwoProducts_WithoutDirector() { // Arrange var builder = new ConcreteBuilder(); // Act builder.BuildPartA(); builder.BuildPartB(); // Assert Assert.AreEqual(2, builder.GetProduct().Parts.Count); }
static void Main(string[] args) { var director = new Director(); var builder = new ConcreteBuilder(); director.Builder = builder; Console.WriteLine("Standard basic product:"); director.BuildMinimalViableProduct(); Console.WriteLine(builder.GetProduct().ListParts()); Console.WriteLine("Standard full featured product"); director.BuildFullFeaturedProduct(); Console.WriteLine(builder.GetProduct().ListParts()); // can be used without A director Console.WriteLine("Custom product:"); builder.BuildPartA(); builder.BuildPartB(); Console.WriteLine(builder.GetProduct().ListParts()); }