fluent Nhibernatetest mappings
Hi there I am using Fluent Nhibernate and I'd 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 开发者_JS百科the UserProfile is a value type, there is a 1:1 relationship between the two.
How would I test the mappings based on 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 time? Thanks
[Test]
public void can_correctly_map_customer()
{
new PersistenceSpecification<Customer>(Session)
.CheckProperty(c => c.Id, 1001)
.CheckProperty(c => c.FirstName, "John")
.CheckProperty(c => c.LastName, "Doe")
}
Persistence specification testing
See the section on testing references.
精彩评论