public void SetsTheErrorMessageToNothingWhenGoogleLoginWasCanceled() { ViewModel.Email = ValidEmail; ViewModel.Password = ValidPassword; var exception = new GoogleLoginException(true); LoginManager.Login(Arg.Any <Email>(), Arg.Any <Password>()) .Returns(Observable.Throw <ITogglDataSource>(exception)); ViewModel.LoginCommand.Execute(); ViewModel.ErrorMessage.Should().BeEmpty(); }
public void SetsTheErrorMessageToNothingWhenGoogleLoginWasCanceled() { var observer = TestScheduler.CreateObserver <string>(); var exception = new GoogleLoginException(true); ViewModel.ErrorMessage.Subscribe(observer); LoginManager.Login(Arg.Any <Email>(), Arg.Any <Password>()) .Returns(Observable.Throw <ITogglDataSource>(exception)); ViewModel.Login(); TestScheduler.Start(); observer.Messages.AssertEqual( ReactiveTest.OnNext(1, "") ); }