Пример #1
0
 public void ValidUser()
 {
     _view.Username.Returns("admin");
     _view.Password.Returns("password");
     _view.Login += Raise.Event <Action>();
     _view.DidNotReceive().ShowError(Arg.Any <string>());
     _controller.Received().Run <MainPresener, User>(Arg.Is <User>(user => user.Name == "admin" && user.Password == "password"));
 }
Пример #2
0
 public void CorrectCredentials_ShowAccountForm()
 {
     _view.UserName.Returns("sa");
     _view.Password.Returns("1");
     _view.Login += Raise.Event <Action>();
     _view.DidNotReceive().ShowMessage(Arg.Any <string>());
     _controller.Received().Run <AccountPresenter, Account>(Arg.Any <Account>());
 }
Пример #3
0
 public void SqlFound()
 {
     service.GetSqlServers().Returns(new List <string>()
     {
         "First", "Second", "Third"
     });
     presenter = new LoginPresenter(controller, view, service);
     presenter.Run();
     view.DidNotReceive().SqlNotFoundFunc();
 }