Mocking Static methods using Rhino.Mocks

前端 未结 6 1070
夕颜
夕颜 2020-11-29 07:14

Is it possible to mock a static method using Rhino.Mocks? If Rhino does not support this, is there a pattern or something which would let me accomplish the same?

6条回答
  •  野趣味
    野趣味 (楼主)
    2020-11-29 07:48

    Wrap the static method call in a virtual instance method in another class, then mock that out.

提交回复
热议问题