szabototo89 / CodeSharper

Refactoring tool, written in C# and using TDD for developing
1 stars 0 forks source link

[core] Constraints should be used as NUnit Assert.That #23

Open szabototo89 opened 9 years ago

szabototo89 commented 9 years ago

Constraints should be used as NUnit Assert.That, for example:

Constraints
  .Check(() => arg1, Is.Not.Null.And.Not.Blank)  // arg1 is not null and not blank
  .Check(() => arg2, Is.Not.Empty) // arg2 is not empty
  .Check(() => arg3, Is.InRange(1,10).Or.InRange(-10, -1));  // arg3 is between 1 and 10 or -10 and -1
szabototo89 commented 9 years ago

Relevant libraries for validation: http://fluentvalidation.codeplex.com/ http://conditions.codeplex.com/