Hello Folks -

I am attempting to use the "DataFixture" attribute - specifically I am
having problem with the string resource I specify for the XML file in
the XmlDataProvider attribute. If I use a constant expression for the
first argument, MbUnit is able to parse the specified XML file resource
and spit out the test cases. Unfortunately, these tests are designed to
be run on the build machine (and possibly other machines) where the
path of the XML resource is not absolute - it can be located (and found
in a fixed location) relative to the application home directory. So in
effect if I tried this -

class UnitTestSuite
{
     public static readonly String OSP_HOME = FindHomeDirectory();
     public static readonly String REG_PATH = OSP_HOME + some string;
     public static readonly String XML_FILE = REG_PATH + "test.xml";
     ....
}

If I used UnitTestSuite.XML_FILE  as the first argument to the
XmlDataProvider() attribute, I receive the following error messge -

"An attribute argument must be a constant expression, typeof expression
or array creation expression"

Is there any way I can circumvent this problem by not using a constant
expression? Would like to avoid it at all costs - would really be my
last resort though.

Cheers

Ranji


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"MbUnit.User" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/MbUnitUser
-~----------~----~----~----~------~----~------~--~---

Reply via email to