using AbstractFactory.Factories; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace AbstractFactory { internal class Client { public void Main() { Console.WriteLine("Client: Testring client code with the first factory type..."); ClientMethod(new ConcreteFactory1()); Console.WriteLine("---"); Console.WriteLine("Client: Testring client code with the second factory type..."); ClientMethod(new ConcreteFactory2()); } private void ClientMethod(IAbstractFactory factory) { var ProductA = factory.CreateProductA(); var ProductB = factory.CreateProductB(); Console.WriteLine(ProductB.UsefulFuctionB()); Console.WriteLine(ProductB.AnotherUsefulFunctionB(ProductA)); } } }