Quantcast
Channel: Fluent Assertions
Viewing all articles
Browse latest Browse all 1402

Closed Issue: Better readability with extension methods on int [10087]

$
0
0
Include Minutes(), Hours() and Days() extension methods on integers, for better readability of DateTime assertions.
For example:

public static TimeSpan Minutes(this int source)
{
return TimeSpan.FromMinutes(source);
}

This allows assertions like:

theDateTime.Should().BeLessThan(10.Minutes().Before(otherDateTime));
Comments: Resolved with changeset 62358.

Viewing all articles
Browse latest Browse all 1402

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>