The way to use moles for Windows Phone 7 projects

I would like to use the Moles library to overload some calls to Mircosoft.Pnone.Net (for example, NetworkInterface.GetIsNetworkAvailable()) for my block tests.

I downloaded the moles installer. Installed it. Then I clicked the link Microsoft.Phoneand selected the menu item "Add Moles Assembley".

And now, when I try to build my solution, I got a bunch of errors like this:

   Error    89  Type 'System.Net.WebRequest' exists in 
'c:\Program Files (x86)\Reference` 

    Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.dll', 
    and also in  'c:\Program Files (x86)\Reference 
    Assemblies\Microsoft\Framework\Silverlight\v4.0\Profile\WindowsPhone71\System.Net.dll' 
    [C:\Projects\{projName}.Tests\obj\Debug\Moles\mp\m.g.csproj]    
    C:\Projects\{projName}.Tests\m.g.cs 39886

Is there a way to correct this ambiguity?

+3
source share
1 answer

Maby, this blog post can help you in the right direction when it comes to unit testing your Windows Phone 7 app.

He's writing:

Portable Library Tool , Windows Phone Windows Phone 7 Visual Studio. , .

+1

All Articles