Example #1
0
        public void ValidateInput_WithAssigneeNameLength_ShouldThrowException()
        {
            var    assigneeValidator = new AssigneeValidator();
            Action action            = () => assigneeValidator.ValidateAssignee(new Assignee()
            {
                Id = 1, Name = "AB"
            });

            action.Should().Throw <InvalidDataException>().WithMessage("Assignee name has to be at least 3 characters long");
        }
Example #2
0
        public void ValidateInput_WithAssigneeNameSpecialChars_ShouldThrowException(string character)
        {
            var    assigneeValidator = new AssigneeValidator();
            Action action            = () => assigneeValidator.ValidateAssignee(new Assignee()
            {
                Id = 1, Name = "ABD" + character
            });

            action.Should().Throw <InvalidDataException>().WithMessage("Assignee name cannot contain any special characters");
        }
Example #3
0
        public void ValidateInput_WithAssigneeNameNull_ShouldThrowException()
        {
            var    assigneeValidator = new AssigneeValidator();
            Action action            = () => assigneeValidator.ValidateAssignee(new Assignee()
            {
                Id = 1
            });

            action.Should().Throw <InvalidDataException>().WithMessage("Assignee must have a name");
        }