0
我正在爲我的Fluent NHibernate映射進行測試,我的問題是 - 如果Id列由Sql Server中的標識表示,測試id值是否是個好主意?由於它在每次插入後都會改變,我怎麼可能做到這一點?在測試Fluent NHibernate映射時測試id值是否是個好主意?
new PersistenceSpecification<Product>(session)
.CheckProperty(p => p.Id, 1)
.CheckProperty(p => p.Name, "Awesome hat")
.CheckProperty(p => p.Price, 9.90)
.CheckList(p => p.StoresStockedIn, new List<Store>())
.VerifyTheMappings();