Groups | Blog | Home
all groups > dotnet sdk > may 2004 >

dotnet sdk : MockObject, SelectSingleNode and NUnit


GurriBurri
5/28/2004 12:11:03 PM
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
5/28/2004 12:51:04 PM
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?


AddThis Social Bookmark Button