Esempio n. 1
0
        public void MediatorTest()
        {
            // The client code.
            var component1 = new Component1();
            var component2 = new Component2();

            new ConcreteMediator(component1, component2);
            component1.DoA().Should().Be("A");
            component2.DoD().Should().Be("D");;
        }
Esempio n. 2
0
    void Start()
    {
        ConcreteMediator = new ConcreteMediator(component1, component2);

        // Debug.Log("Client triggets operation A.");
        component1.DoA();

        Debug.Log("__");

        //  Debug.Log("Client triggers operation D.");
        component2.DoD();
    }
Esempio n. 3
0
        public void Run()
        {
            Component1 component1 = new Component1();
            Component2 component2 = new Component2();

            new ConcreteMediator(component1, component2);

            Console.WriteLine("Client triggets operation A.");
            component1.DoA();

            Console.WriteLine();

            Console.WriteLine("Client triggers operation D.");
            component2.DoD();
        }
Esempio n. 4
0
        static void Main(string[] args)
        {
            // The client code.
            Component1 component1 = new Component1();
            Component2 component2 = new Component2();

            new ConcreteMediator(component1, component2);

            Console.WriteLine("Client triggets operation A.");
            component1.DoA();

            Console.WriteLine();

            Console.WriteLine("Client triggers operation D.");
            component2.DoD();
        }
Esempio n. 5
0
        public void Ex1()
        {
            // The client code.
            Component1 component1 = new Component1();
            Component2 component2 = new Component2();

            new ConcreteMediator(component1, component2);

            Console.WriteLine("Client triggers operation A.");
            component1.DoA(); // Triggar även C

            Console.WriteLine();

            Console.WriteLine("Client triggers operation D.");
            component2.DoD(); // Triggar även B och C
        }