I have the following Databases that have the same schema
GCLUnitTest
GCLDevelopmentV1_0_9
I generated the code by refreshing against the GCLDevelopmentV1_0_9 database.
I run my unit tests against the GCLUnitTest database. I change the catalog name by using unit test config files. When I run I get the following error:
Initialization method Payjr.GCL.Test.ProductTest.MyTestInitialize threw exception. SD.LLBLGen.Pro.ORMSupportClasses.ORMQueryExecutionException: SD.LLBLGen.Pro.ORMSupportClasses.ORMQueryExecutionException: An exception was caught during the execution of an action query: Invalid object name 'GCLDevelopmentV1_0_9.dbo.OrderCart'.. Check InnerException, QueryExecuted and Parameters of this exception to examine the cause of this exception. ---> System.Data.SqlClient.SqlException: Invalid object name 'GCLDevelopmentV1_0_9.dbo.OrderCart'..
Stack Trace:
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async)
at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe)
at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
at SD.LLBLGen.Pro.ORMSupportClasses.ActionQuery.Execute()
--- End of inner exception stack trace ---
at SD.LLBLGen.Pro.ORMSupportClasses.ActionQuery.Execute()
at SD.LLBLGen.Pro.ORMSupportClasses.DaoBase.ExecuteActionQuery(IActionQuery queryToExecute, ITransaction containingTransaction)
at SD.LLBLGen.Pro.ORMSupportClasses.DaoBase.DeleteMulti(ITransaction containingTransaction, IPredicate deleteFilter, IRelationCollection relations)
at SD.LLBLGen.Pro.ORMSupportClasses.EntityCollectionBase`1.DeleteMulti(IPredicate deleteFilter, IRelationCollection relations)
at SD.LLBLGen.Pro.ORMSupportClasses.EntityCollectionBase`1.DeleteMulti(IPredicate deleteFilter)
I just converted my project over the using SelfService objects. (I no longer have the adapter classes in the project). When I run the unit tests using
the adapter classes I'm able to use the different catalog name. When I run with the SelfServing it throws an exception. When I have the same catalog name as when it was generated it works fine.
(GCLDevelopmentV1_0_9)