示例#1
0
        public void ShouldReturnSuccessMessageOnUserAccountCreation()
        {
            var accountCreator = new UserAccountCreator();
            var result         = accountCreator.CreateUser("ValidUser", "Abc123456");

            Assert.That(result, Is.EqualTo("Account Created Successfuly"));
        }
示例#2
0
        public void ShouldReturnFailureMessageWhenInvalidPassword()
        {
            var accountCreator = new UserAccountCreator();
            var result         = accountCreator.CreateUser("ValidUser", "Abc123");

            Assert.That(result, Is.EqualTo("Account Creation Failed"));
        }
示例#3
0
        public void ShouldNotIncreaseTheUserCountInListOnUserCreationFailure()
        {
            var userCreator = new UserAccountCreator();

            userCreator.CreateUser("InvalidUser123", "1234");

            Assert.AreEqual(0, userCreator.Users.Count);
        }
示例#4
0
        public void ShouldIncreaseTheUserCountInListOnUserCreation()
        {
            var userCreator = new UserAccountCreator();

            userCreator.CreateUser("ValidUser", "Abc123456");

            Assert.AreEqual(1, userCreator.Users.Count);
        }
示例#5
0
        public void ShouldReturnFailureMessageOnIncorrectPassword()
        {
            var userCreator = new UserAccountCreator();

            userCreator.CreateUser(validUser_, validPassword_);

            var loginHelper = new LoginHelper(userCreator);
            var result      = loginHelper.Login(validUser_, "WrongPassword");

            Assert.AreEqual("Login Failed", result);
        }
示例#6
0
        public void ShouldReturnSuccessMessageOnSuccessfulLogin()
        {
            var accountCreator = new UserAccountCreator();

            accountCreator.CreateUser(validUser_, validPassword_);

            var loginHelper = new LoginHelper(accountCreator);
            var result      = loginHelper.Login(validUser_, validPassword_);

            Assert.AreEqual("Login Successful", result);
        }
示例#7
0
        public void UserListShouldNotBeNullEvenIfNoUserCreated()
        {
            var userCreator = new UserAccountCreator();

            Assert.IsNotNull(userCreator.Users);
        }