Invalid call, the last call has been used or no call has been made

后端 未结 5 949
夕颜
夕颜 2021-01-07 19:12

I am getting this error when I try to set a mock to have PropertyBehavior():

System.InvalidOperationException: System.InvalidOperationEx

5条回答
  •  星月不相逢
    2021-01-07 19:47

    Never used PropertyBehavior before, but is this the syntax you're looking for?

    form.Stub(x=>x.OKButtonEnabled).PropertyBehavior()
    

    Rhino Mocks works completely through extension methods now. The only static call I every make any more is to MockRepository.GenerateStub.

提交回复
热议问题