public void When_FirstNameRuleNotApplyWhenIdLessThenZero() { var validator = new TestValidatorWithWhen(); var em = new CreateEmployeeRequest { Id = -1, FirstName = "", EmployeeID = 1, DateOfBirth = DateTime.Now.AddMonths(-1) }; var validationResult = validator.Validate(em); Assert.That(validationResult.IsValid, Is.True); }
public void When_FirstNameShouldBeNotEmptyWhenIdGreateThenZero() { var validator = new TestValidatorWithWhen(); var em = new CreateEmployeeRequest { Id = 2, FirstName = "", EmployeeID = 1, DateOfBirth = DateTime.Now.AddMonths(-1) }; var validationResult = validator.Validate(em); Assert.That(validationResult.IsValid, Is.False); }