I am using entity framework and storing a DateTime with kind as 'Utc'.
For unit testing puroposes when retrieving this DateTime from the database it is coming out with an 'unspecified' kind and different ticks value.
I understand that Entity Framework cannot automatically assign it the Utc kind but I cannot understand why it would come out with a different ticks value.
This is a problem since I am using Mspec to test the retrieved value against the one that was put in using
result.Date.ShouldEqual(retrievedDate)
This statement is returning false since the kinds on each value are different. I also tried:
DateTime.Compare(result.Date, retrievedDate)
but this returned false since the ticks value is different.