public void DeadlinePatchValidation_DateFromThePast_ShouldReturnError() { // Arrange var validator = new DeadlinePatchValidator(); var deadlinePatch = TestData.Deadline.CreateDeadlinePatch(); deadlinePatch.Date = DateTime.Today.AddDays(-1); // Act var result = validator.TestValidate(deadlinePatch); // Assert result.IsValid.Should().BeFalse(); result.ShouldHaveValidationErrorFor(a => a.Date.Date); }
public void DeadlinePatchValidator_EmptyText_ShouldReturnError() { // Arrange var validator = new DeadlinePatchValidator(); var deadlinePatch = TestData.Deadline.CreateDeadlinePatch(); deadlinePatch.Name = string.Empty; // Act var result = validator.TestValidate(deadlinePatch); // Assert result.IsValid.Should().BeFalse(); result.ShouldHaveValidationErrorFor(a => a.Name); }