This question is locked. New answers and comments are not allowed.
Hi,
I seem to be having some problems getting things configured properly for unit testing.
I'm using VS unit test framework. I've read How to: Use OpenAccess ORM with Test Frameworks but my set up seems to be a bit different. I have a BLL that does all the CRUD and other functionality. It is also where business objects have to be created so their values can be properly initalized.
I don't want any class other than the BLL to have to have any knowledge of OA, (other than using the Business Objects) including creating an ObjectScopeProvider. I would, preferably, like the unit test to just create a new BLL and then go about using it.
Here is what is currently happening:
1. The unit test start.
2. The unit test tries to create a new BLL -> Dim bll As New psDataEntities.PsBllOpenAccess
3. The BLL's new is called and then the BLL tries to create a IObjectScope ->Dim scope As Telerik.OpenAccess.IObjectScope = ObjectScopeProvider1.GetNewObjectScope
4. In the BLL project's ObjectScopeProvider1, GetObjectScope is called.
5. Eventually the Database function is called. It is unable to create the database and on the line:
theObjectScopeProvider1._myDatabase = Telerik.OpenAccess.Database.Get( "DatabaseConnection1" )
The metadata for the db at this point is:
{"Telerik.OpenAccess: No enhanced assembly has been found for meta-data construction. This may be caused by a missing app.config file (use app.config as embedded resource then) or by an insufficient references section in the configuration file (add the referenced enhanced assemblies there too) or by a wrong enhancement setting; please check your configuration."}
I've tried every combination of:
1. enhancing the unit test to use Persistent Classes and/or Data Access Code
2. Setting the app.config for the unit test and bll to embedded resource or do nothing
3. Turning of Enhancing and Update Database setting for the unit test.
What are the proper settings? Am I missing something more basic?
Any thoughts would be greatly appreciated
Thanks.
I seem to be having some problems getting things configured properly for unit testing.
I'm using VS unit test framework. I've read How to: Use OpenAccess ORM with Test Frameworks but my set up seems to be a bit different. I have a BLL that does all the CRUD and other functionality. It is also where business objects have to be created so their values can be properly initalized.
I don't want any class other than the BLL to have to have any knowledge of OA, (other than using the Business Objects) including creating an ObjectScopeProvider. I would, preferably, like the unit test to just create a new BLL and then go about using it.
Here is what is currently happening:
1. The unit test start.
2. The unit test tries to create a new BLL -> Dim bll As New psDataEntities.PsBllOpenAccess
3. The BLL's new is called and then the BLL tries to create a IObjectScope ->Dim scope As Telerik.OpenAccess.IObjectScope = ObjectScopeProvider1.GetNewObjectScope
4. In the BLL project's ObjectScopeProvider1, GetObjectScope is called.
5. Eventually the Database function is called. It is unable to create the database and on the line:
theObjectScopeProvider1._myDatabase = Telerik.OpenAccess.Database.Get( "DatabaseConnection1" )
The metadata for the db at this point is:
{"Telerik.OpenAccess: No enhanced assembly has been found for meta-data construction. This may be caused by a missing app.config file (use app.config as embedded resource then) or by an insufficient references section in the configuration file (add the referenced enhanced assemblies there too) or by a wrong enhancement setting; please check your configuration."}
I've tried every combination of:
1. enhancing the unit test to use Persistent Classes and/or Data Access Code
2. Setting the app.config for the unit test and bll to embedded resource or do nothing
3. Turning of Enhancing and Update Database setting for the unit test.
What are the proper settings? Am I missing something more basic?
Any thoughts would be greatly appreciated
Thanks.