public void ctor_WhenViewIsLoaded_CallsViewRender() { var mockView = Substitute.For <IView_CH5>(); Presenter_CH5 p = new Presenter_CH5(mockView); mockView.Loaded += Raise.Event <Action>(); mockView.Received() .Render(Arg.Is <string>(s => s.Contains("Hello World"))); }
public void ctor_WhenViewHasError_CallsLogger() { var stubView = Substitute.For <IView_CH5>(); var mockLogger = Substitute.For <ILogger>(); Presenter_CH5 p = new Presenter_CH5(stubView, mockLogger); stubView.ErrorOccured += Raise.Event <Action <string> >("fake error"); mockLogger.Received() .LogError(Arg.Is <string>(s => s.Contains("fake error"))); }