Exemplo n.º 1
0
        public void Employee_ShouldNotValidateIfPasswordEmpty()
        {
            //Arrange
            var employee = new Employee()
            {
                Login = "******",
                Name = "Andrzej",
                Surname = "Kowalski",
            };

            //Act
            var errorCount = 0;
            foreach (var error in employee.Validate())
                errorCount++;
            //Assert
            Assert.AreEqual(errorCount, 1);

            //Arrange
            employee.Password = Security.CalculateMD5Hash("");
            //Act
            errorCount = 0;
            foreach (var error in employee.Validate())
                errorCount++;
            //Assert
            Assert.AreEqual(errorCount, 1);
        }
Exemplo n.º 2
0
        public void Employee_ShouldNotValidateIfLoginEmpty()
        {
            //Arrange
            var employee = new Employee()
                {
                    Name = "Andrzej",
                    Surname = "Kowalski",
                    Password = "******"
                };

            //Act
            var errorCount = 0;
            foreach (var error in employee.Validate())
                errorCount++;
            //Assert
            Assert.AreEqual(errorCount,1);
        }