jeudi 9 juillet 2015

Rhino Mocks failing with System.MissingMethodException : Method not found exception

I have a unit test which is failing with the below error

System.MissingMethodException : Method not found: 'Boolean Foo.get_Showpage()'.

Foo doeesn't have an Interface

I have recently added a new boolean property into Foo.cs which was Showpage and the tests are failing after that.

And the test case looks something like this

public void Sampletest()
{
  var boo = MockRepository.GenerateStub<IBoo>();
  boo.Stub(x=>x.Foo).Return(new Foo());
  var result = _controller.Inder(Id);
  result.Should().BeOfType<ViewResult>("index");
}

How can I fix this?

Aucun commentaire:

Enregistrer un commentaire