valit-stack / Valit

Valit is dead simple validation for .NET Core. No more if-statements all around your code. Write nice and clean fluent validators instead!
MIT License
322 stars 26 forks source link

Feature/114 comparing two properties #131

Closed paw3lx closed 6 years ago

paw3lx commented 6 years ago

Info

This Pull Request is related to issue no. #114

Guys, I added few lines of code to provide possibility to compare two properties. It's just a draft, so please take a look. I was not sure about it so I just added one Ensure method and one test to test if it's working. I think that now we have two possibilities:

  1. To have many Ensure methods. They can look like in this PR
  2. Replace Ensure methods to have only one way of creating ValitRules. This could be big change I guess. As @GooRiOn said, it could piss off all folks that use Valit.

What do you think?

Changes

codecov[bot] commented 6 years ago

Codecov Report

Merging #131 into develop will not change coverage. The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff           @@
##           develop   #131   +/-   ##
======================================
  Coverage      100%   100%           
======================================
  Files           38     38           
  Lines          784    815   +31     
======================================
+ Hits           784    815   +31
Impacted Files Coverage Δ
src/Valit/ValitRuleUInt64Extensions.cs 100% <ø> (ø) :arrow_up:
src/Valit/ValitStrategies.cs 100% <ø> (ø) :arrow_up:
src/Valit/ValitException.cs 100% <ø> (ø) :arrow_up:
src/Valit/ValitRuleUInt32Extensions.cs 100% <ø> (ø) :arrow_up:
src/Valit/ValitRuleInt32Extensions.cs 100% <ø> (ø) :arrow_up:
src/Valit/CompleteValitStrategy.cs 100% <ø> (ø) :arrow_up:
src/Valit/MessageProvider/EmptyMessageProvider.cs 100% <ø> (ø) :arrow_up:
src/Valit/Exceptions/ValitExceptionExtensions.cs 100% <ø> (ø) :arrow_up:
src/Valit/ValitRuleDoubleExtensions.cs 100% <ø> (ø) :arrow_up:
src/Valit/ValitStrategiesExtensions.cs 100% <ø> (ø) :arrow_up:
... and 31 more

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update eb68fc0...1eb3bfb. Read the comment docs.

GooRiOn commented 6 years ago

I like this way of creating the rules. Now we need to decide what to do with that.

@arekbal @dbarwikowski @tdeschryver what are your thoughts?

We should not hurry with the decision, tommorow I'd like to release version 0.2.0 so this task will be scheduled for the 0.3.0 release (so before christmass).