Could someone explain why both tests while using latest versions of Moq and Rhino.Mocks frameworks fail worrying that Bar isn't a virtual/overridable method:
public interface IFoo public class Foo : IFoo [TestMethod] public void MoqTest() [TestMethod] public void RhinoTest()
Basically declare Bar method as virtual both tests pass. I do not realise why I must declare Bar as virtual. Is not it already virtual? It comes down in the interface.
Virtual is area of the class not the interface, therefore if you want to override the technique around the class Foo you will have to declare it as being virtual.
However as Krzysztof mentions if all that's necessary would be the techniques around the interface IFoo then you definitely should mock the interface.
Because you are mocking Foo class. Mock IFoo intefrace rather
var foo = new MockRepository().PartialMock<IFoo>()