public CounterMediator(CounterA counterA, CounterB counterB) { _counterA = counterA; _counterA.SetMediator(this); _counterB = counterB; _counterB.SetMediator(this); }
public void CounterAShouldReceiveMessage() { var counterA = new CounterA(); var counterB = new CounterB(); new CounterMediator(counterA, counterB); string message = "Hi Counter A"; var counterAReceived = counterB.Send(message); Assert.AreEqual(counterAReceived, $"Counter A received message: {message}"); }