Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / .NET SDK / May 2004

Tip: Looking for answers? Try searching our database.

MockObject, SelectSingleNode and NUnit

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
GurriBurri - 28 May 2004 20:11 GMT
Hell
I have a small and strange problem

I am trying to write some testcases for NUnit 2.1, and I have an Abstract class XYZ that defines
a XmlDocument and functions that manipulates it, for example getAnElement(Name) which uses
SelectSingleNode to find and return the element. I obvoiusly then uses this set of funtions in subclasses
Everything is fine this long, but when I am trying to write a testcase för NUnit I get a NullReferenceException
in the unittests. I have created a mockClass that inherit the abstract class for testing purposes, and I have
also singled out the problem to the lines where I use SelectSingleNode on the XmlDocument in the
abstract class.

I am lost here, anybody knows whats up?
GurriBurri - 28 May 2004 20:51 GMT
I forgot: When I try the code with a normal teststub i.e. not in the NUnit testcase it works fine. Its only in the NUnit testclass that I get the NullReferenceException.
   
    ----- GurriBurri wrote: ----
   
    Hell
    I have a small and strange problem
   
    I am trying to write some testcases for NUnit 2.1, and I have an Abstract class XYZ that defines
    a XmlDocument and functions that manipulates it, for example getAnElement(Name) which uses
    SelectSingleNode to find and return the element. I obvoiusly then uses this set of funtions in subclasses
    Everything is fine this long, but when I am trying to write a testcase för NUnit I get a NullReferenceException
    in the unittests. I have created a mockClass that inherit the abstract class for testing purposes, and I have
    also singled out the problem to the lines where I use SelectSingleNode on the XmlDocument in the
    abstract class.
   
    I am lost here, anybody knows whats up?

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.