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

Commented Issue: Better error msg when AllProperties() fails on DateTime [11839]

$
0
0
Include the property name in the error message when the property is a DateTime.

[TestMethod]
public void Should()
{
var expected = new Car {MfgDate= new DateTime(2011, 1, 1)};
var actual = new Car { MfgDate= new DateTime(2012, 2, 2) };
actual.ShouldHave().AllProperties().EqualTo(expected);
}

Actual error message from FluentAssertions

Expected <2011-01-01>, but found <2012-02-02>.

should be something like:

Expected property ***MfgDate*** <2011-01-01>, but found <2012-02-02>.
Comments: Associated with changeset 74167.

Viewing all articles
Browse latest Browse all 1402

Trending Articles



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