示例#1
0
        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);
        }
示例#2
0
        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);
        }