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); }
public GroupController(GroupRepository repository) { _repository = repository; _validator = new CreateGroupRequestValidator(); }