Well this feature does not exist yet, you wold need to exit the XmlDataProviderAttribute class to support this format. You can modify the existing xmldataproviderattribute (I think a little bit more of configurability could be added anyway). Notice that this requires a little change in the API since you need to provider the fixture type:
public class XmlDataProviderAttribute¨
{
public override StreamReader LoadResource(Type fixtureType)
{
if (!this.ResourceName.StartsWith("M:"))
return base.LoadResource();
// here we can get the method name and invoque it
string methodName = this.ResourceName.Substring(2);
MethodInfo loader = fixtureType.GetMethod(resourceName, BindingArgs.Public |BindingArgs.Static);
return (StreamReader)loader.Invoke(null, null);
}
}
Note that this is a rough sketch, error checking needs to be added.
On 5/19/06, Ranji <[EMAIL PROTECTED]
> wrote:
Jonathan -
Could you amplify on the sysntax :
[XmlDataProvider("M:GetSampleFile()", "//DataFixture/Employees")]
What is M: - Is it a special attribute - I now have a static
GetSampleFile() method that returns the location of the XML resource as
a string but I get an error message indicating -
"FailedLoading(Could not find a part of the path 'M:\GetXMLFile()'.).
Am I missing something ?
Thanks
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---
- MbUnit XmlDataProvider attribute Ranji
- MbUnit Re: XmlDataProvider attribute David Strickland
- MbUnit Re: XmlDataProvider attribute Jay Flowers
- MbUnit Re: XmlDataProvider attribute David Strickland
- MbUnit Re: XmlDataProvider attribute Ranji
- MbUnit Re: XmlDataProvider attribute Jonathan de Halleux
- MbUnit Re: XmlDataProvider attri... Ranji
- MbUnit Re: XmlDataProvider a... Jonathan de Halleux
- MbUnit Re: XmlDataProvid... Jonathan de Halleux
- MbUnit Re: XmlDataProvid... Andrew Stopford
- MbUnit Re: XmlDataProvid... Ranji
- MbUnit Re: XmlDataProvid... Ranji
