Tuesday, November 18, 2008

NUnit Fluent Interface Gem

I really like NUnit's fluent interface for constraints, and have been using it a lot. The gem I learned today is about specifying an acceptance range:
  DateTime actual, expected;
  // ...
  Assert.That(actual, Is.EqualTo(expected).Within(TimeSpan.FromSeconds(3)));