public void Check_Abstract_Factory_Returns_Correct_Objects()
        {
            AbstractFactory  factory1 = new Factory1();
            AbstractProductA product1 = factory1.CreateProductA();
            AbstractProductB product2 = factory1.CreateProductB();

            Assert.AreEqual(product1.GetType(), typeof(ProductA1));
            Assert.AreEqual(product2.GetType(), typeof(ProductB1));
        }
Exemplo n.º 2
0
 public override void Wytworz(AbstractProductB typ)
 {
     Console.WriteLine(this.GetType().Name + typ.GetType().Name);
 }
Exemplo n.º 3
0
 public override void Interact(AbstractProductB b)
 {
     Console.WriteLine(this.GetType().Name + "interact with" + b.GetType().Name);
 }
 public override void Interact(AbstractProductB b)
 {
     Console.WriteLine(this.GetType().Name + " interacts with " + b.GetType().Name);
 }