I have an Address mapped as a component on a Customer class and I want
to test the Customer mapping.

How should I do this? This doesn't work:

new PersistenceSpecification<Customer>(session)
    .CheckProperty(x => x.Address, new Address {
        Address1 = "Blah",
        Address2 = "Blah",
        new Country { Id = 1, Title = "Test" }
    });

(System.ApplicationException: Expected 'Domain.Customer.Address' but
got 'Domain.Customer.Address' for Property 'Address')

Nor does this:

new PersistenceSpecification<Customer>(session)
    .CheckProperty(x => x.Address.Address1, "Blah")
    .CheckProperty(x => x.Address.Address2, "Blah")
    .CheckProperty(x => x.Address.Country.Id, 1)
    .CheckProperty(x => x.Address.Country.Title, "Blah");

(System.Reflection.TargetException: Object does not match target
type.)




--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Fluent NHibernate" group.
To post to this group, send email to fluent-nhibernate@googlegroups.com
To unsubscribe from this group, send email to 
fluent-nhibernate+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/fluent-nhibernate?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to