I'm encountering an issue when verifying the mappings on a very simple class.
System.ApplicationException : For property 'Created' expected same element, but got different element with the same value '8/9/2011 12:07:55 AM' of type 'System.DateTime'. Tip: use a CustomEqualityComparer when creating the PersistenceSpecification object.
I have tried creating overrides for the equals and get hashcode methods and that resulted in the same error. I dug into the custom equality comparer for persistence specification testing and again hit the same error. I should perhaps take a look at this with a fresh set of eyes in the morning but I feel i'm missing something very basic.
Thanks all.
public class Blah
{
public int Id { get; set; }
public DateTime Created { get; set; }
public string Description { get; set; }
}
[Test]
public void Can_Correctly_Map_Blah()
{
new PersistenceSpecification<Blah>(Session)
.CheckProperty(c => c.Id, 1)
.CheckProperty(c => c.Description, "Big Description")
.CheckProperty(c => c.Created, System.DateTime.Now)
.VerifyTheMappings();
}