public void UnsubscribeFromSubject() { var subject = Substitute.For <ISubject>(); var subscriber = new NumberFan { Subscription = subject }; subscriber.Unsubscribe(subject); subject.Received().RemoveSubscriber(Arg.Is(subscriber)); subscriber.Subscription.ShouldBeNull(); }
private static string UnsubscribeDecision(Stopwatch stopwatch, string stopTrigger) { stopwatch.Stop(); Write( "Do You Think I Should Stay With This Number? Then Type \"Unsubscribe\" to make me unsubscribe from the subject: "); var userInput = ReadLine(); if (userInput == "Unsubscribe") { fanBoy.Unsubscribe(randoNumber); stopTrigger = "Keep Going"; WriteLine("The things are decoupled now!"); } stopwatch.Start(); return(stopTrigger); }