fer*_*ega 3 c# nunit mocking windows-runtime .net-4.5
首先,这是一个Microsoft Store winrt 库,我正在尝试使用此签名测试公共方法:
string GetStringFromFile(StorageFile storageFile);
Run Code Online (Sandbox Code Playgroud)
但是StorageFile
没有构造函数,所以我不能在我的 NUnit 测试代码上创建它。另外,我想我不能Moq
在 WinRt 上使用或任何其他 Mocking 库。
我一直在寻找从 IStorageFile 接口创建一个手工制作的假货,但它内部有很多方法,我再次坚持另一个深层属性,指出内部没有公共构造函数的类,StorageFile
如ImageProperties
示例所示。
那么......使用StorageFile
和/或ImageProperties
类测试方法的最佳方法是什么?
归档时间: |
|
查看次数: |
498 次 |
最近记录: |