Ошибка при запуске метода теста rhinomock: Метод теста TestProject1.UnitTest2.TestMethod1 выдал исключение:
Rhino.Mocks.Exceptions.ExpectationViolationException: ITestInterface.Method1 (5); Ожидаемый # 1, фактический # 0.
Мой код выглядит так: -
namespace ClassLibrary1
{
public interface ITestInterface
{
bool Method1(int x);
int Method(int a);
}
internal class TestClass : ITestInterface
{
public bool Method1(int x)
{
return true;
}
public int Method(int a)
{
return a;
}
}
}
И мой тест выглядит примерно так: -
using ClassLibrary1;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Rhino.Mocks;
namespace TestProject1
{
[TestClass]
public class UnitTest2
{
[TestMethod]
public void TestMethod1()
{
ITestInterface mockProxy = MockRepository.GenerateMock<ITestInterface>();
TestClass tc = new TestClass();
bool result = tc.Method1(5);
Assert.IsTrue(result);
mockProxy.AssertWasCalled(x => x.Method1(5));
}
}
}
Любая помощь приветствуется.