public void ValidateInput_WithTaskDescLength_ShouldThrowException() { var taskValidator = new TaskValidator(); Action action = () => taskValidator.ValidateTask(new Task() { Id = 1, AssigneeId = 1, Assignee = new Assignee() { Id = 1, Name = "Dave" }, Description = "AYY", DueDate = DateTime.Now }); action.Should().Throw <InvalidDataException>().WithMessage("Task description has to be at least 5 characters long"); }
public void ValidateInput_WithTaskDescriptionNull_ShouldThrowException() { var taskValidator = new TaskValidator(); Action action = () => taskValidator.ValidateTask(new Task() { Id = 1, AssigneeId = 1, Assignee = new Assignee() { Id = 1, Name = "Dave" }, DueDate = DateTime.Now }); action.Should().Throw <InvalidDataException>().WithMessage("Task must have a description"); }
public void CanThrowAnExceptionOnNullStuff() { var simpleTask = new TestTask(null, "echo {}"); TaskValidator.ValidateTask(simpleTask); }
public void CanThrowAnExceptionOnEmptyParameters() { var simpleTask = new TestTask(""); TaskValidator.ValidateTask(simpleTask); }