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");; }
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(); }
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(); }
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(); }
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 }