魔灵系统.dll
我需要对使用 System.dll
中的 System.Net.WebClient
的方法进行单元测试。我尝试对 System.dll
进行鼹鼠操作,但是当我尝试编译项目以添加对 System.dll
鼹鼠的引用时,出现了一堆如下错误:
错误2
'System.Net.Moles.SFileWebResponse.Dispose(bool)': 没有找到合适的方法来覆盖 [C:\DGALibrary\DGALib.IO.Tests\obj\x86\Debug\Moles\s\mgcsproj] C: \DGALibrary\DGALib.IO.Tests\mgcs 251374 33 DGALib.IO.Tests
错误 3
“System.Net.Moles.SFileWebResponse.SupportsHeaders”:找不到合适的方法来覆盖 [C:\DGALibrary\DGALib.IO.Tests\obj\x86\Debug\Moles\s\mgcsproj] C:\DGALibrary\ DGALib.IO.Tests\mgcs 251575 30 DGALib.IO.Tests
错误 4
'System.Net.Moles.SHttpWebResponse.Dispose(bool)': 没有找到合适的方法来覆盖 [C:\DGALibrary\DGALib.IO.Tests\obj\x86\Debug\Moles\s\mgcsproj] C: \DGALibrary\DGALib.IO.Tests\mgcs 255264 33 DGALib.IO.Tests
错误 5
“System.Net.Moles.SHttpWebResponse.SupportsHeaders”:找不到合适的方法来覆盖 [C:\DGALibrary\DGALib.IO.Tests\obj\x86\Debug\Moles\s\mgcsproj] C:\DGALibrary\ DGALib.IO.Tests\mgcs 255465 30 DGALib.IO.Tests
错误 6
'System.Net.Moles.SWebResponse.Dispose(bool)': 没有找到合适的方法来覆盖 [C:\DGALibrary\DGALib.IO.Tests\obj\x86\Debug\Moles\s\mgcsproj] C: \DGALibrary\DGALib.IO.Tests\mgcs 303123 33 DGALib.IO.Tests
错误 7
“System.Net.Moles.SWebResponse.SupportsHeaders”:找不到合适的方法来覆盖 [C:\DGALibrary\DGALib.IO.Tests\obj\x86\Debug\Moles\s\mgcsproj] C:\DGALibrary\ DGALib.IO.Tests\mgcs 303324 30 DGALib.IO.Tests
错误 8
'System.Net.Moles.SFileWebResponse.Dispose(bool)': 没有找到合适的方法来覆盖 [C:\DGALibrary\DGALib.IO.Tests\obj\x86\Debug\Moles\s\mgcsproj] C: \DGALibrary\DGALib.IO.Tests\mgcs 251374 33 DGALib.IO.Tests
最后是
错误 28
命令“”C:\Program Files\Microsoft Moles\bin\moles.exe”@C:\DGALibrary\DGALib.IO.Tests\obj\x86\Debug\Moles\moles.args”退出,代码为 - 1002. DGALib.IO.测试
我们是否无法监视system.dll
?
I need to unit test a method that is using the System.Net.WebClient
in the System.dll
. I tried to Mole the System.dll
, but when I tried to compile the project to add references to the System.dll
mole, I got a bunch of errors like the following:
Error 2
'System.Net.Moles.SFileWebResponse.Dispose(bool)': no suitable method found to override [C:\DGALibrary\DGALib.IO.Tests\obj\x86\Debug\Moles\s\m.g.csproj] C:\DGALibrary\DGALib.IO.Tests\m.g.cs 251374 33 DGALib.IO.Tests
Error 3
'System.Net.Moles.SFileWebResponse.SupportsHeaders': no suitable method found to override [C:\DGALibrary\DGALib.IO.Tests\obj\x86\Debug\Moles\s\m.g.csproj] C:\DGALibrary\DGALib.IO.Tests\m.g.cs 251575 30 DGALib.IO.Tests
Error 4
'System.Net.Moles.SHttpWebResponse.Dispose(bool)': no suitable method found to override [C:\DGALibrary\DGALib.IO.Tests\obj\x86\Debug\Moles\s\m.g.csproj] C:\DGALibrary\DGALib.IO.Tests\m.g.cs 255264 33 DGALib.IO.Tests
Error 5
'System.Net.Moles.SHttpWebResponse.SupportsHeaders': no suitable method found to override [C:\DGALibrary\DGALib.IO.Tests\obj\x86\Debug\Moles\s\m.g.csproj] C:\DGALibrary\DGALib.IO.Tests\m.g.cs 255465 30 DGALib.IO.Tests
Error 6
'System.Net.Moles.SWebResponse.Dispose(bool)': no suitable method found to override [C:\DGALibrary\DGALib.IO.Tests\obj\x86\Debug\Moles\s\m.g.csproj] C:\DGALibrary\DGALib.IO.Tests\m.g.cs 303123 33 DGALib.IO.Tests
Error 7
'System.Net.Moles.SWebResponse.SupportsHeaders': no suitable method found to override [C:\DGALibrary\DGALib.IO.Tests\obj\x86\Debug\Moles\s\m.g.csproj] C:\DGALibrary\DGALib.IO.Tests\m.g.cs 303324 30 DGALib.IO.Tests
Error 8
'System.Net.Moles.SFileWebResponse.Dispose(bool)': no suitable method found to override [C:\DGALibrary\DGALib.IO.Tests\obj\x86\Debug\Moles\s\m.g.csproj] C:\DGALibrary\DGALib.IO.Tests\m.g.cs 251374 33 DGALib.IO.Tests
And finally
Error 28
The command ""C:\Program Files\Microsoft Moles\bin\moles.exe" @C:\DGALibrary\DGALib.IO.Tests\obj\x86\Debug\Moles\moles.args" exited with code -1002. DGALib.IO.Tests
Are we not able to mole system.dll
?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
试试这个
try this
我是 Pex/Moles 的新手,所以我无法向您提供有关错误发生原因的答案。但是,只要错误不是针对您实际需要 Mole 的类型,您就可以通过编辑 system.moles 文件来将 Mole 类型限制为您关心的类型来解决您的问题。
I'm new to Pex/Moles so I can't provide you with an answer as to why the errors are occurring. However, so long as the errors aren't for types you actually need to Mole you can resolve your problem by editing the system.moles file to restrict the types to mole to just the ones you care about.