public void BeginBuild(ComplexProduct existingComplexProduct = null) { if (existingComplexProduct == null) { _complexProduct = new ComplexProduct(); } else { _complexProduct = existingComplexProduct; } }
public void TestCase1() { AbstractComplexProductBuilder builder = new ConcreteProductBuilderA("Sunday", 9); GoodWeatherAndGoodLuckDirector director = new GoodWeatherAndGoodLuckDirector(); builder.BeginBuild(); director.ConstructWithGoodWeatherAndGoodLuck(builder); ComplexProduct productWithGoodLuck = builder.EndBuild(); builder.BeginBuild(); director.ConstructWithBadWeatherAndBadLuck(builder); ComplexProduct productWithBadLuck = builder.EndBuild(); }