Example #1
0
        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();
            }
        }
Example #2
0
        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);
        }
Example #3
0
 public void StoryValidatorTest()
 {
     var storyValidator = new StoryValidator();
     var story = new Story();
     ValidationResults result = storyValidator.Validate(story);
 }
Example #4
0
 public void StoryValidatorTest()
 {
     var storyValidator       = new StoryValidator();
     var story                = new Story();
     ValidationResults result = storyValidator.Validate(story);
 }