예제 #1
0
        public void xU_U_AuthenticateUser_ValidUserNameAndInvalidPassword_ReturnFalse()
        {
            //Arrange
            var mock = new Mock<IUserRepository>();
            mock.Setup(m => m.GetAll()).Returns(TestPreparation.CreateUsers().AsQueryable());
            var targetObject = new UserServices(mock.Object);
            var userName = "******";
            var password = "******";

            //Act
            var result = targetObject.AuthenticateUser(userName, password);

            //Assert
            Assert.False(result);
        }
예제 #2
0
        public void MS_Int_AuthenticateUser_ValidUserNameAndInvalidPassword_ReturnFalse()
        {
            //Initialize
            _devUtilities.ExecuteSqlScriptFile(_connectionString, TestUtilities.ProjectDirectory() + "\\SQLScripts\\Int_AuthenticateUser_WithValidCredentials_ReturnTrue.sql");

            //Arrange
            var targetObject = new UserServices(new EfUserRepository());
            var userName = "******";
            var password = "******";

            //Act
            var result = targetObject.AuthenticateUser(userName, password);

            //Assert
            Assert.IsFalse(result);

            //Cleaning
            _devUtilities.DeleteTableDataAndRessedId("Users", _connectionString);
        }
예제 #3
0
        public void xU_Int_AuthenticateUser_ValidUserNameAndInvalidPassword_ReturnFalse()
        {
            //Initialize
            Initilize();
            _devUtilities.ExecuteSqlScriptContent(_connectionString, SqlStatementStrings.IntAuthenticateUserWithValidCredentialsReturnTrue);

            //Arrange
            var targetObject = new UserServices(new EfUserRepository());
            var userName = "******";
            var password = "******";

            //Act
            var result = targetObject.AuthenticateUser(userName, password);

            //Assert
            Assert.False(result);

            //Cleaning
            _devUtilities.DeleteTableDataAndRessedId("Users", _connectionString);
        }