【问题标题】:What is LastCall for in RhinoMocks?RhinoMocks 中的 LastCall 是什么?
【发布时间】:2011-08-12 23:28:04
【问题描述】:

rhino mock 中lastcall 方法有什么用? 能不能用例子来解释一下?

【问题讨论】:

    标签: unit-testing testing rhino-mocks


    【解决方案1】:

    LastCall 允许您在添加的最后一个呼叫之外执行其他操作。

    Expect.Call(delegate{ mockObject.DoSomething("foo"); }).IgnoreArguments(); 
    

    是一样的

    mockObject.DoSomething("foo"); 
    LastCall.IgnoreArguments(); 
    

    希望这会有所帮助。

    【讨论】:

      猜你喜欢
      • 2019-10-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-09-06
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多