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

Created Issue: Support asserting that a datetime is close to another datetime [12070]

$
0
0
It would be nice if you could assert that a DateTime value is close to another DateTime value. This can be useful for example when a database truncates datetime values. The acceptable difference in time could be an optional parameter with a default value of, say, 20 ms.
The syntx could be:

time.Should().BeCloseTo(otherTime); // succeeds if time is within 20 ms of otherTime
time.Should().BeCloseTo(otherTime, 30); // succeeds if time is within 30 ms of otherTime

Viewing all articles
Browse latest Browse all 1402

Trending Articles



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