Deprecated database, free NHibernate and testing my mappings

As the message header suggests, I have an outdated database (not sure if this is important), I'm using Fluent NHibernate, and I'm trying to check my mappings using the Fluent NHincernate PersistenceSpecification class .

My question is really a process, I want to test them when I create locally in Visual Studio using the built-in module testing platform. Obviously, this implies (I think) that I will need a database. What are some features for this in the assembly? If I use a database in a database, does NHibernate or Fluent NHibernate have some mechanism for sucking the database schema from the target database, or maybe the database in the database can do this? Do I need to manually get a schema to feed into the database in memory?

Ideally, I would like to get this setting where other developers really donโ€™t need to think about it, except when they break the build because the tests fail.

+3
source share
1 answer

NHibernate cannot recreate your database schema and because it is an outdated system, it will probably not be able to generate the schema from NH. The best approach is to conduct your integration tests in transactions and roll them back at completion. We run integration tests with our test databases, which are periodically updated from a live system.

+2
source

Source: https://habr.com/ru/post/1736520/


All Articles