public void RegisterCommandExecuted_ModelRegisterReturnsFalse_MessageServiceShowErrorCalled()
        {
            _model.Register("", "").ReturnsForAnyArgs(false);
            _uut.RegisterCommand.Execute(null);

            _messageService.Received().ShowError("Failed to create user");
        }
        private async void DoRegister()
        {
            try
            {
                bool userCreated = await _model.Register(UserName, Password);

                if (userCreated)
                {
                    _wos.OpenMainWindow();
                }
                else
                {
                    _messageService.ShowError("Failed to create user");
                }
            }
            catch (TaskCanceledException e)
            {
                Log.File.Exception(e);
                _messageService.ShowError("No connection to server.");
            }
            catch (HttpRequestException e)
            {
                Log.File.Exception(e);
                _messageService.ShowError("You are not connected to the grand internet. please fix!");
            }
        }
示例#3
0
 public void Register_UsernameIsBent_CollectorCreateUserReceivesBent()
 {
     _uut.Register("Bent", "");
     _collector.Received().CreateUser("Bent", Arg.Any <string>());
 }