public void Bridge_Test()
        {
            var abs          = new Abstraction();
            var implementer  = new ImplementerA();
            var absRedefined = new RedefinedAbstraction();

            abs.Implementer          = implementer;
            absRedefined.Implementer = implementer;

            Assert.AreNotEqual(abs.Operation(), absRedefined.Operation());
        }
Exemplo n.º 2
0
        static void Main(string[] args)
        {
            Abstraction ab = new RedefinedAbstraction();

            ab.SetImplementor(new ConcreteImplementorA());
            ab.Operation();

            ab.SetImplementor(new ConcreteImplementorB());
            ab.Operation();
            Console.ReadKey();
        }