DevChatter / ChatterBot

Highly modular Twitch chat bot.
MIT License
10 stars 5 forks source link

For consideration - adoption of FluentValidation to allow self contained validations and community help with unit tests #18

Closed SimonGeering closed 4 years ago

SimonGeering commented 4 years ago

A question for discussion

If the app were to adopt FluentValidation as the main validation mechanism for MediatR requests and other object validation rules, then it would be possible for @benrick to create validation rules on stream and then solicit volunteer help to add unit tests for them afterwards, using the validator as a specification.

If desired, it is also possible to integrate validators into the MediatR pipeline - See https://softdevben.blogspot.com/2017/12/using-mediatr-pipeline-with-fluent.html

benrick commented 4 years ago

I think this is a great idea and a good way to make contributing to the project easier for people to step into.

benrick commented 4 years ago

Mulling over the idea in my head, I'm thinking this would work very nicely for the code for various plugins. For example, if there's one for establishing a custom channel currency (for those who want something different than the now built-in channel points), there would absolutely be some validation rules around commands that give/take currency both as a normal user and as a moderator.

SimonGeering commented 4 years ago

Is there a good candidate for a first Validator by way of example that could be included with a PR for this issue. That way we could get the package in along with an example validator and associated unit test.

benrick commented 4 years ago

Not many of the features are in yet, but my guess would be that commands would make for a good first candidate to have validation in place.

SimonGeering commented 4 years ago

Thanks, now that PRs are up to date I'll take a look at this next.