Esempio n. 1
0
        public void EmployeeValidator_ShouldHaveRules()
        {
            var employeeValidator = new EmployeeValidator();

            employeeValidator.ShouldHaveValidationErrorFor(v => v.FirstName, null as string);
            employeeValidator.ShouldHaveValidationErrorFor(v => v.PersonType, Domain.Enums.PersonType.Dependent);
            employeeValidator.ShouldHaveChildValidator(v => v.Dependents, typeof(DependentValidator));
        }
Esempio n. 2
0
        public void Should_have_error_when_HourWorked_is_null_or_Negative()
        {
            validator = new EmployeeValidator();

            Employee EmployeeObjTest = BuilderEmployee.Create().WorkedFor(-1).Build();

            validator.ShouldHaveValidationErrorFor(e => e.HoursWorked, EmployeeObjTest);
        }
Esempio n. 3
0
        public void Should_have_error_when_HourRate_is_null_or_Invalid()
        {
            Employee EmployeeObjTest = BuilderEmployee.Create().EarnsForHour(-1).Build();

            validator.ShouldHaveValidationErrorFor(e => e.HourRate, EmployeeObjTest);
        }