是否可以使用WMI为方法编写nunit [英] is it possible to write nunit for the methods using WMI

查看:68
本文介绍了是否可以使用WMI为方法编写nunit的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨大家好,

我正在尝试为使用WMI的方法编写nunit。

我没有成功。现在我怀疑是否可以为使用WMI的方法完成nunit。

如果有可能请给我一些示例代码。

Hi folks,
i am trying to write nunit for the methods which uses WMI.
and i am not succeded in that. and now im doubting whether nunit can be done for methods which uses WMI.
if it is possible kindly give me some sample code.

推荐答案

您无需为WMI编写NUnint。

可以模拟这些函数 [ ^ ]你可以假设WMI会给你正确的结果,或者他们会给你不正确的结果。



然后你可以为这两种结果类型编写测试用例。



您可以使用其他可用的第三方代替Moles。选择你喜欢的东西。
You need not really write NUnint for WMI.
These functions can be mocked[^] and you can assume is that either WMI will give you correct results or they will give you incorrect results.

You can then write test cases for these two result types.

Instead of Moles you can use other third parties that are available. Choose what you are comfortable with.


这篇关于是否可以使用WMI为方法编写nunit的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆