public void ConcreteFactory2Test() { AbstractFactory factory = new ConcreteFactory2(); Assert.IsInstanceOfType(factory.CreateProductA(), typeof(ProductA2)); Assert.IsInstanceOfType(factory.CreateProductB(), typeof(ProductB2)); }
public void Test() { var factory = new ConcreteFactory2(); var productA = factory.CreateProductA(); var productB = factory.CreateProductB(); Assert.IsTrue(productA is ProductA2Y); Assert.IsTrue(productB is ProductB2); }