Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeOur CommunityOur CommunityGeneral Discuss...General Discuss...Testing DNN Module with MBUnit.Testing DNN Module with MBUnit.
Previous
 
Next
New Post
2/29/2008 3:10 AM
 

Hello

I was following Philip Beadle's blogs for TDD for DNN modules. I have started to add similar approach in one of my existing module.

My module usage DAL+. I have not created my own separate SqlDataProvider, instead I am using DotNetNuke.Data.DataProvider.Instance().ExecuteNonQuery() and other generic methods.

When I started my tests in MBUnit I was getting Null object exceptions from "DotNetNuke.Data.DataProvider.Instance()".

I did some digging and found, that following line was not able to create object.

    objType = BuildManager.GetType(TypeName, True, True)

(DNN 4.8.1, \Library\Components\Framework\Reflection.vb Line#:278)

But why is that so - its working while I use site in browser. And thats where I found answer - BuildManager is "Provides a set of methods to help manage the compilation of an ASP.NET application.". So that means its work fine in ASP.NET running environment but not when you are using it in MBUnit thread.

Finally what I found is there was no AssemblyName passed in "TypeName" parameter for "BuildManager.GetType()" so it try to find that class in all loaded assemblies (in current thread domain). And no way "DotNetNuke.SqlDataProvider" will be loaded my MBUnit.

To resolve this issue, I just update a single line in DNN DataProvider class.

From:         Private Const ProviderAssemblyName As String = ""

To:               Private Const ProviderAssemblyName As String = "DotNetNuke"

(DNN 4.8.1, \Library\Components\Providers\Data\DataProvider.vb Line#:32)


This change works fine in both ASP.NET and MBUnit environment. I will really appreciate if this tiny update can make in to DNN core.

 
Previous
 
Next
HomeHomeOur CommunityOur CommunityGeneral Discuss...General Discuss...Testing DNN Module with MBUnit.Testing DNN Module with MBUnit.


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, 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 DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out