views:

17

answers:

1

Hi there I am using fluent Nhibernate and Id like to write tests for my mappings as shown below I have a scenario where I have a User class, and a UserProfile class

The User class is an entity and the UserProfile is a value type, there is a 1:1 relationship between the two. How would I test the mappings based ont this, do I write separate tests for User and UserProfile? or am I able to write a test for User that maps the profile at the same tmie? Thanks

[Test]

public void can_correctly_map_customer() { new PersistenceSpecification(Session) .CheckProperty(c => c.Id, 1001) .CheckProperty(c => c.FirstName, "John") .CheckProperty(c => c.LastName, "Doe") }

A: 

http://wiki.fluentnhibernate.org/Persistence_specification_testing

See the section on testing references.

bleevo