Small width layout Medium width layout Maximum width layout Small text Medium text Large text
     Search
Downloads Downloads Directory Directory Forums Forums Forge Forge Blogs Blogs        Marketplace Marketplace Careers Program Careers
Community › Forums Register  |  

AspDotNetStoreFront
  Ads  
Biz Modules provides professional business modules and solutions for DotNetNuke
 


  Sponsors  

Meet Our Sponsors

WebSecureStores -- ASP.NET & DotNetNuke Hosting Solutions
FCKeditor Project
Salaro -- Skins and more
OnyakTech
The best choice for your web site host, email hosting, and domain registration.
CrystalTech Web Hosting™
 


DotNetNuke Forums
 
  Forum  General DotNetN...  Extend It! ( Pr...  Unit Testing with mbunit/ DAL+
Previous Previous
 
Next Next
New Post 6/30/2008 5:05 AM
User is offline jimmy
7 posts
10th Ranked


Unit Testing with mbunit/ DAL+ 

hi,

im currently trying to get some unit tests for a custom DNN module to run. The problem i am running into is when i try to fetch an instance of the DAL+ DataProvider-

[code]

DataProvider d = DotNetNuke.Data.DataProvider.Instance();

[/code]

 

When this code is executed, the following error occurs:

 

System.TypeInitializationException: The type initializer for 'DotNetNuke.Data.DataProvider' threw an exception. ---> System.NullReferenceException: Object reference not set to an instance of an object.
   at DotNetNuke.Framework.Reflection.CreateObject(String ObjectProviderType, String ObjectProviderName, String ObjectNamespace, String ObjectAssemblyName, Boolean UseCache)
   at DotNetNuke.Data.DataProvider.CreateProvider()
   at DotNetNuke.Data.DataProvider..cctor()
   --- End of inner exception stack trace ---

 

ive been scouring every post on DNN module testing and ive turned up nothing (except something about DNN reflection and making sure all references are present and correct, which they seem to be), if anyone could help me out i would be very grateful.

 

 
New Post 6/30/2008 7:38 AM
User is offline Jim Bonnie
116 posts
www.walkspoiled.com
9th Ranked






Re: Unit Testing with mbunit/ DAL+ 
Modified By Jim Bonnie  on 6/30/2008 9:39:18 AM)

Jimmy,

I have not tried to unit test against the DAL+. It is likely that it is not fully constructed when trying to call it from your unit/integration tests.

Can you isolate your logic so that it can be tested without the DAL, providing dummy data ?

I have had more success using other Data Access tools that can be instiantiated without the DNN core Framework.

Have you tried Subsonic ?


Jim www.walkspoiled.com
 
New Post 6/30/2008 9:10 AM
User is offline james luck
1 posts
10th Ranked


Re: Unit Testing with mbunit/ DAL+ 

Hi Jim, thanks for the response

i think seperating my logic from the DAL would be a bit fustrating and wouldnt achieve that much, i want to check that when i pass in paramaters for the DAL to execute that they have been correctly passed, typed etc.

i will be looking into subsonic, it looks like a very useful tool, thanks for the FYI!

 
New Post 7/1/2008 11:43 AM
User is offline Jim Bonnie
116 posts
www.walkspoiled.com
9th Ranked






Re: Unit Testing with mbunit/ DAL+ 

 

Here is a link to the DNN Unit testing Project on codeplex, http://www.codeplex.com/TestDrivenDNNModule

It may shed some light on how to achieve what your after.

Good Luck.

 


Jim www.walkspoiled.com
 
Previous Previous
 
Next Next
  Forum  General DotNetN...  Extend It! ( Pr...  Unit Testing with mbunit/ DAL+
 


Forum Policy

These Discussion Forums are dedicated to the discussion of the DotNetNuke Web Application Framework.

For the benefit of the community and to protect the integrity of the project, please observe the following posting guidelines:

1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DotNetNuke.
2. Discussion or promotion of DotNetNuke product releases under a different brand name are strictly prohibited.
3. No Flaming or Trolling.
4. No Profanity, Racism, or Prejudice.
5. Site Moderators have the final word on approving/removing a thread or post or comment.
6. English language posting only, please.

 


Subzero Solutions
Dutch / English DotNetNuke consultancy services. Custom module development in any version. Complete application integration. Small business portal hosting. Your ideas our innovation - Your success our motivation. K.v.k Amsterdam: 34236342
www.subzero-solutions.net
Hosting for DotNetNuke
SiteGround.com is the best place to host your DotNetNuke website! Expert DotNetNuke support, reliable servers, low price!
www.SiteGround.com
Code Endeavors, LLC
Do you Endeavor to Enhance your DotNetNuke designs by utilizing AJAX technologies to more efficient interactive web experiences
www.codeendeavors.com

DotNetNuke Corporation   Terms Of Use  Privacy Statement
DotNetNuke®, DNN®, and the DotNetNuke logo are trademarks of DotNetNuke Corporation
Hosted by MaximumASP