public void ShouldPassOnValidGroup()
        {
            var group = GetValidRequest();

            var validator = new CreateGroupRequestValidator();
            var result    = validator.Validate(group);

            Assert.True(result.IsValid);
        }
        public void ShouldFailOnEmptyName()
        {
            var group = GetValidRequest();

            group.Name = "";

            var validator = new CreateGroupRequestValidator();
            var result    = validator.Validate(group);

            Assert.False(result.IsValid);
        }
        public void ShouldFailOnNameTooLong()
        {
            var group = GetValidRequest();

            group.Name = new string('*', 101);

            var validator = new CreateGroupRequestValidator();
            var result    = validator.Validate(group);

            Assert.False(result.IsValid);
        }
예제 #4
0
 public GroupController(GroupRepository repository)
 {
     _repository = repository;
     _validator  = new CreateGroupRequestValidator();
 }