That looks like a syntax error from the compiler.
It sounds like you're trying to reference a field from within an attribute
definition, which is not supported by the language.
You can try this though: (approximately)
[Test]
[Row("abc", 123)]
[Row("def", 456)]
public void Test(string a, int b)
{
IMyInterface stub = MockRepository.CreateStub<IMyInterface>();
Expect.Call(stub.A).Return(a);
Expect.Call(stub.B).Return(b);
MockRepository.Playback();
// Use stub here.
Assert.... whatever...
}
Jeff.
On Sat, Nov 1, 2008 at 11:17 AM, Lars Zeb <[EMAIL PROTECTED]> wrote:
>
> I am a new user of MbUnit. In testing a class, I use a RhinoMock stub
> which is based on an Interface.
>
> I create the stub in the Setup fixture. If I try to reference the stub
> in the Row collection, I get the following error:
>
> An object reference is required for the non-static field, method, or
> property
>
> I was hoping I could create various instances of the stub each holding
> different values and testing each of the stubs via the Row attribute.
>
> Is there a way to do this, I should I just create different Test
> methods for each stub?
>
> Thanks, Lars
> >
>
--~--~---------~--~----~------------~-------~--~----~
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?hl=en
-~----------~----~----~----~------~----~------~--~---