szabototo89 / CodeSharper

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

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

Open szabototo89 opened 10 years ago

szabototo89 commented 10 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 10 years ago

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