public static ITextHandOff CreateMultiObserver(this IEnumerable<ITextHandOff> channels) { var multiobserver = new TextHandoffBroadcast(); foreach(var channel in channels) multiobserver.AddSubscriber(channel); return multiobserver; }
public void When_notifying_one_observer() { var observerA = new TextHandOffObserver(); var multiObserver = new TextHandoffBroadcast(); multiObserver.AddSubscriber(observerA); multiObserver.Handoff("TEST!"); Assert.That(observerA.ReceivedText, Is.EqualTo("TEST!")); }