Hi. Cool code. This is not relevant to the topic but since there are no arguments in the DateTime constructor (DateTime expected = new DateTime();) expected variable data is set to the default value making your Assert always to fail . Assert.That.SqlDatesAreEqual(result.Accepted.Value, expected); How are you getting data into "expected " variable? Thanks
@JeffZuerlein10 ай бұрын
This is why I shouldn't post things on the internet while I'm going on a rant. :^) I fiddled with a real test to put the focus on the DateTime comparison. Normally what I do is to have properties in the test class to represent the expected values. An initialization function uses AutoFixture to populate those expected values and put them in the DB. That way when I test the repository's get method, I have something to compare the results to.
@nickcodes543010 ай бұрын
@@JeffZuerlein Ah, that makes sense! Thank you, Sir!