I’m testing a Fluent NH mapping and I have a problem:
The code:
[TestMethod()]
public void FilterMapConstructorTest()
{
new PersistenceSpecification<Filter>(session)
.CheckProperty(c => c.Id, 1)
.CheckProperty(c => c.FilterValue, "1")
.CheckProperty(c => c.IdAttribute, 1)
.CheckProperty(c => c.Type, Filter.FilterType.Equals)
.VerifyTheMappings();
}
De compilator don’t recognice the variable “session”, I should declare this, or import any using?
Thank’s for your time.
Best Regards
You need to actually get a new NHibernate session from your session factory before you can use it. Below is a more detailed example: