public void Validate(params bool[] properties) { var validateAllStory = properties.ListIsNullOrEmpty() ? true : properties.ElementAt(0); var validator = new StoryValidator(validateAllStory); var isValid = validator.Validate(this).IsValid; if (!isValid) { throw new ValidationException(); } }
public CreateStoryResponse Handle(CreateStoryRequest request) { var response = new CreateStoryResponse { Story = new Story(request.Name) }; var validator = new StoryValidator(); var validationResult = validator.Validate(response.Story); return(response); }
public void StoryValidatorTest() { var storyValidator = new StoryValidator(); var story = new Story(); ValidationResults result = storyValidator.Validate(story); }