Following is a simple TestMethod which which passes successfully using ITestInterface
ITestInterface mockProxy = MockRepository.GenerateMock<ITestInterface>();
OR
ITestInterface mockProxy = MockRepository.GenerateStub<ITestInterface>();
Can someone help me which one to use in this specific scenario.
Following is TestMethod for testing a business layer method and x.Method is a Data Access Layer method.
[TestMethod]
public void TestMethod1()
{
ITestInterface mockProxy = MockRepository.GenerateMock<ITestInterface>();
ITestInterface mockProxy = MockRepository.GenerateStub<ITestInterface>();
mockProxy.Stub(x => x.Method(Arg<int>.Is.Anything)).Return(10);
var result = mockProxy.BusinessLayerMethod(10);
Assert.AreEqual(10, result);
}