I remember having this error, which is really weird ("Expect"
shouldn't accept any arguments, it's not a method). As far as I
remember, something with the naming conflict. You can 1) try
specifying the namespace for Expect; 2) use Option Strict, Explicit,
and stuff; 3) use LastCall instead of Expect.Call; 4) switch to AAA
(recommended).

As for the AAA syntax, it might be a problem in VB due to halfway
support of lambdas, but here's a clue:
http://blogs.lessthandot.com/index.php/DesktopDev/MSTech/vb-net-rhino-mocks-and-the-aaa-syntax-1

Have fun!

ulu

On Jul 7, 5:42 am, TheMightyKumquat <[email protected]> wrote:
> Hi. Just getting started on RhinoMocks and I'm puzzled why I can code
> this in C#, but coding it in VB.Net gives a compile error.
>
>            using (mocks.Record())
>            {
>                ***** ERROR LINE ***** Expect.Call
> (timeController.MyMethod(t)).Return(fakeObj);
>            }
>            using (mocks.Playback())
>            {
>                TestInt y = timeController.ReturnSame(t);
>                Assert.AreEqual(fakeObj, y);
>            }
>
> If I code this exact statement in VB.Net, I get a compile error on the
> Expect.Call line.
>
> The message is "Overload resolution failed because no accessible
> 'Expect' accepts this number of arguments."
>
> This is really causing me problems, because I don't know of any other
> code that will set a return value for a method called on my mock
> object. So two questions:
> - why am I getting the error in VB.Net? &
> - is there any alternative syntax? (Recoding the tests in C# is not an
> option - company policy is to code in VB.Net)
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Rhino.Mocks" 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/RhinoMocks?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to