Пример #1
0
        public void Test()
        {
            IAbstractFactory factory  = new ConcreteFactory2();
            IProductA        productA = factory.CreateProducctA();
            IProductB        productB = factory.CreateProducctB();

            Assert.AreEqual <Type>(typeof(ProductA2Y), productA.GetType());
            Assert.AreEqual <Type>(typeof(ProductB2), productB.GetType());
        }
Пример #2
0
        public void Test()
        {
            var factory  = new ConcreteFactory2();
            var productA = factory.CreateProducctA();
            var productB = factory.CreateProducctB();

            Assert.IsTrue(productA is ProductA2Y);
            Assert.IsTrue(productB is ProductB2);
        }