Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Help with Connection string for Entity Framework project
Message
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Miscellaneous
Thread ID:
01530977
Message ID:
01531024
Views:
36
>Navneet,
>
>>Just created the EF project and then the test project using VS2010 build in Testing tool.
>>
>>Getting the following message when running the test method "GetOrderDetail":
>>
>>System.NullReferenceException was unhandled by user code
>> Message=Object reference not set to an instance of an object.
>> Source=OakLeaf.MM2010.Framework
>> StackTrace:
>> at OakLeaf.MM.Main.mmAppBase.get_DatabaseMgr()
>> at OakLeaf.MM.Main.Business.mmBusinessObject.GetDataAccessObject(String databaseKey, Boolean localDataAccessObject)
>> at OakLeaf.MM.Main.Business.mmBusinessObject.GetDataAccessObject(String databaseKey)
>> at OakLeaf.MM.Main.Business.mmBusinessObject.GetDataAccessObject()
>> at OakLeaf.MM.Main.Business.mmBusinessObjectHelperEF.GetEntityList[T,EntityType](IQueryable`1 objectQuery, MergeOption mergeOption, Boolean isSecondaryList, mmBusinessObjectGeneric`1 businessObject)
>> at OakLeaf.MM.Main.Business.mmBusinessObjectGeneric`1.GetEntityList[T](IQueryable`1 objectQuery, MergeOption mergeOption, Boolean isSecondaryList)
>> at OakLeaf.MM.Main.Business.mmBusinessObjectGeneric`1.GetEntityList[T](IQueryable`1 objectQuery, MergeOption mergeOption)
>> at OakLeaf.MM.Main.Business.mmBusinessObjectGeneric`1.GetEntityList(IQueryable`1 objectQuery)
>> at ACME.OrderSystem.BusinessEF.OrderDetail.GetOrderDetail(Nullable`1 orderID) in C:\mm.netJumpStart\Order System BO EF\OrderDetail\OrderDetail.Partial.cs:line 48
>> at TestProject1.UnitTest1.TestGetOrderDetailByOrderID() in c:\mm.netJumpStart\TestProject1\UnitTest1.cs:line 68
>> InnerException:
>
>When running unit tests, you need to set up your environment by instantiating an instance of the AAppTestFactory class (located in the AAppTest file) using the following code:
>
>
mmAppBase.Factory = new AAppTestFactory();
>mmAppBase.IsRunning = true;
>
>Only after doing this can you call the methods on your business objects.
>

Kudos for supporting the EF in your framework!
Previous
Reply
Map
View

Click here to load this message in the networking platform