1
有没有办法在单元测试中用模拟对象替换客户端库(它与远程服务器通信)?图解释什么,我试图做用测试中的模拟替换客户端库?
+---------------+
| tests |----{ mock }
+---------------+ |
| |
v |
+---------------+ |
| model | |
+---------------+ |
| |
v |
+---------------+ |
| client-module |<--{replaces}
+---------------+
^
:
:
v
+---------------+
| service |
+---------------+
因为测试导入模型,其中进口客户端模块
这里,似乎没有被应用模拟的方式到模型的内部。