public void Validate_OK() { var dut = new UpdateActionDtoValidator(); var validUpdateActionDto = new UpdateActionDto { Title = "UpdatedActionTitle", Description = "UpdatedActionDescription", DueTimeUtc = new DateTime(2020, 1, 1, 1, 1, 1, DateTimeKind.Utc) }; var result = dut.Validate(validUpdateActionDto); Assert.IsTrue(result.IsValid); }
public void Fail_WhenDescriptionIsTooLong() { var dut = new UpdateActionDtoValidator(); var inValidUpdateActionDto = new UpdateActionDto { Title = "NewActionTitle", Description = new string('x', Action.DescriptionLengthMax + 1), DueTimeUtc = new DateTime(2020, 1, 1, 1, 1, 1, DateTimeKind.Utc) }; var result = dut.Validate(inValidUpdateActionDto); Assert.IsFalse(result.IsValid); }