Unit testing MembershipProvider

C

Cooper Blake

Hello,

I'm trying to unit test an asp.net application. We are using the .net 2..0
authentication / loginView, etc. web controls, with a customized
MembershipProvider (MP) class to connect to an Oracle database. NUnit is
our unit testing framework, and I want to test the creation of a user in
the database.

NUnit loads the web.config file just fine, and can connect to the database
using configuration settings. I can initialize the custom MP, but when I
call CreateUser, it fails when calling the constructor for the .NET
MembershipUser object. The error is that it cannot load the custom
membership provider from this internal .NET class, even though I am using
the same assembly in my code. The specific error:

Membership creation threw an exception: Could not load type
'XXX.XXX.OracleMembershipProvider' from assembly 'System.Web,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'..
----> System.TypeLoadException : Could not load type
'XXX.XXX.OracleMembershipProvider' from assembly 'System.Web,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'..

Why is this failing? The error seems to indicate that the assembly can't
be found, but I'm using the fully qualified class name including our
custom namespace. Is there some hard-coded dependency on a running
asp.net instance? Is there any other way for me to call this CreateUser
function without needing an asp.net instance?

thanks,
Cooper Blake
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,968
Messages
2,570,152
Members
46,697
Latest member
AugustNabo

Latest Threads

Top