public void Validate_OK() { var dut = new CreateActionDtoValidator(); var validCreateActionDto = new CreateActionDto { Title = "ActionTitle", Description = "ActionDescription", DueTimeUtc = new DateTime(2020, 1, 1, 1, 1, 1, DateTimeKind.Utc) }; var result = dut.Validate(validCreateActionDto); Assert.IsTrue(result.IsValid); }
public void Fail_WhenDescriptionIsTooLong() { var dut = new CreateActionDtoValidator(); var inValidCreateActionDto = new CreateActionDto { Title = "ActionTitle", Description = new string('x', Action.DescriptionLengthMax + 1), DueTimeUtc = new DateTime(2020, 1, 1, 1, 1, 1, DateTimeKind.Utc) }; var result = dut.Validate(inValidCreateActionDto); Assert.IsFalse(result.IsValid); }