ling鼠System.dll [英] Moling System.dll
问题描述
我需要对使用System.dll
中的System.Net.WebClient
的方法进行单元测试.我试图对System.dll
进行痣处理,但是当我尝试编译项目以添加对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:
错误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
'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
错误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
'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
错误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
'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
错误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
'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
错误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
'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
错误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
'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
错误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
'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
最后
错误28
命令"C:\ Program Files \ Microsoft Moles \ bin \ moles.exe" @C:\ DGALibrary \ DGALib.IO.Tests \ obj \ x86 \ Debug \ Moles \ moles.args退出,代码为- 1002. DGALib.IO.Tests
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
我们不能骚扰system.dll
吗?
推荐答案
尝试一下
<Moles xmlns="http://schemas.microsoft.com/moles/2010/">
<Assembly Name="System" ExportedTypes="true" ReflectionOnly="true"/>
</Moles>
这篇关于ling鼠System.dll的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!