public class simplemocking
{
public interface IFoo
{
int foo ();
}
public void fii()
{
IFoo foo = MockRepository.GenerateMock<IFoo> ();
SetupResult.For (foo.foo ()).Return (5).Repeat.Any ();
Console.WriteLine (foo.foo ());
}
}
Exception:
Invalid call, the last call has been
used or no call has been made (make
sure that you are calling a virtual
(C#) / Overridable (VB) method).
Maybe you can try to use extension methods instead of SetupFor
Replace the second line by :