Example #1
0
        public void RegisterCommandExecuted_CollectorCreateUserReturnsFalse_MessageServiceShowErrorCalled()
        {
            _collector.CreateUser("", "").ReturnsForAnyArgs(false);
            _sut.RegisterCommand.Execute(null);

            _messageService.Received().ShowError("Failed to create user");
        }
Example #2
0
        /// <summary>
        /// Uses the userCollector to perform a registration
        /// Id successfull created user gets all userinfo with <see cref="GetUserInfo"/>
        /// </summary>
        /// <param name="userName">Username to perform login with</param>
        /// <param name="password">Password to perform login with</param>
        /// <returns>True if user created
        /// False if not</returns>
        public async Task <bool> Register(string userName, string password)
        {
            bool created = await _collector.CreateUser(userName, password);

            if (created)
            {
                Username = userName;
                GetUserInfo(userName);
            }
            return(created);
        }
Example #3
0
 public void Login_CollectorCreateUserReturnsTrue_UutUsernameIsSet()
 {
     _collector.CreateUser("", "").ReturnsForAnyArgs(true);
     _uut.Register("Bent", "Secret");
     Assert.That(_uut.Username, Is.EqualTo("Bent"));
 }