You're now forced to find a way of providing arguments to the mock object instantiation process to achieve the same effect, which is precisely why you use RMock.
您现在必须找到一种方法把参数提供给模拟对象实例化过程以达到同样的效果,这就是使用 RMock 的原因。
The signature of the method is similar to that of the jMock CGLIB mock() method because both methods take on unique mock object identifiers as arguments.
方法的签名类似于jMockCGLIBmock() 方法的签名,因为这两种方法将接纳惟一模拟对象标识符作为参数。
By placing assertions inside the mock code, you can verify that the code under test is passing the correct arguments to its collaborators at the right time.
通过把断言放在mock代码中,可以检查要测试的代码是否在适当的时候把适当的参数传递给它的协作者。
You'll get an error immediately if a mock method is called more times than expected or with the wrong arguments.
如果某个mock方法的调用次数超过了期望值或是参数不正确你就会立刻看到一个错误。
Here is the jsfiddle. For test purpose, I replaced doAjax arguments by a mock factory call, but the code stay the same.
我认为你的代码是做正确的方式,把你的电话在一个新的推迟,直到所有的尝试都达到了回报。
Here is the jsfiddle. For test purpose, I replaced doAjax arguments by a mock factory call, but the code stay the same.
我认为你的代码是做正确的方式,把你的电话在一个新的推迟,直到所有的尝试都达到了回报。
应用推荐