pex-and-moles

Moling System.dll

徘徊边缘 提交于 2020-01-21 08:59:45
问题 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

Microsoft Moles HostType errors in TFS 2010 Lab Management environment

半腔热情 提交于 2019-12-23 05:47:04
问题 I'm using TFS 2010 SP1 Lab Management and a variation on the LapDeployTemplate to execute build workflows and unit tests on a Hyper-V VM, managed via SCVMM (per the ALM Rangers Lab Management Guidance doco on codeplex). After configuring all of this, I've created a Test Plan containing test cases that map to automated unit/integration tests that use Moles. I've used tcm.exe import these test cases and get them into the Microsoft Test Manager. I'm getting the following error when I try to

Moles and SharePoint Behaviour types

给你一囗甜甜゛ 提交于 2019-12-20 02:28:54
问题 We are having problems with the following code: BSPSite site = new BSPSite(); BSPWeb web = site.SetRootWeb(); The error is : Could not load file or assembly 'System.Moles, Version=4.0.0.0, Culture=neutral, PublicKeyToken=0ae41878053f6703' or one of its dependencies. The system cannot find the file specified. We have tried rebuilding the Behavoir assembly in the source code to .NET 4 but that didn't go through. We are using v0.94. Any help would be appreciates. 回答1: 1) Go to C:\Program Files

Using Moles with DateTime

不羁的心 提交于 2019-12-19 03:31:48
问题 I'm starting to using Moles in unit tests and am struggling a little with documentation. I want to mole DateTime.Now. If you look around the old way of doing this was to add a reference to mscorlib, then add a stubx file for it (Add New Item -> Stubs And Moles For Testing). The 'Stubs and Moles for Testing' template has been deprecated, instead all you need do is to right click a reference and select 'Add moles assembly', whch is fine. VS2010 does not allow you to add a reference directly to

Can't reference Microsoft.Moles.Framework.dll in Visual Studio 2010 SP1

家住魔仙堡 提交于 2019-12-11 15:28:05
问题 Actually I already resolved this issue but still I'm not really happy with the way I resolved this issue. I have VS2010 SP1 and I need SP1 to work with Azure SDK. First of all installing Pex and Moles somehow created problems with System.XML.dll. It just disappeared from References in all projects. I had to explicitly find it and connect it to all solutions that used it. Also, there was a bigger issue with Moles itself. TestProjects just weren't able to find Microsoft.Moles.Framework.dll. And

Moles and internal classes

妖精的绣舞 提交于 2019-12-11 11:49:49
问题 We are using Moles currently to test some code that interacts with a 3rd party library. The library was not setup for testing very well (hence the need for moles) and the issue that I am running into is that they only publicly expose a single abstract class. The concrete implementations are internal to the 3rd party library. The issue I am facing is that when trying to create an instance of the public type it is requesting a concrete type from moles, but moles isn't generating moles objects

Can't access information from configuration files when tests have host type “Moles”

早过忘川 提交于 2019-12-10 21:25:51
问题 We are having problems accessing information in .net configuration files (such as app.config and web.config) via unit tests when the unit tests have a host type of "Moles". It's causing quite a few headaches, so I hope someone has an idea on what can be done. We're using Visual Studio 2010, and I believe we've tried this on a machine with VS 2010 SP1 installed, and machine without SP1 installed, as well as trying it on 32 bit and 64 bit machines. I've taken the liberty of reducing the test to

Moles/VS2010 SP1 Issue - Error 32, exit code -1002 building mstest with Moles 0.94.51023.0

倖福魔咒の 提交于 2019-12-08 08:50:54
问题 Update 6/20/2011 I can only build the test project once or twice before getting this error. Moles is unusable for me until this is resolved. Deleting obj/bin and closing/reopening visual studio isn't practical. The Error Error 32 The command ""C:\Program Files\Microsoft Moles\bin\moles.exe" @C:\src\qp\mvc3\Solution\QP.Tests.Moles\obj\Debug\Moles\moles.args" exited with code -1002. QP.Tests.Moles The Description Was trying to use moles with nunit but had trouble... so I created a new mstest

Has anyone made moles work properly?

我与影子孤独终老i 提交于 2019-12-07 22:30:28
问题 I was trying to find a consistent description on how to use moles isolation framework but haven't found much on this topic. So far i did the following: Download moles from here (x86 version). Install it. Here guy describes how to use it with custom library. So i added moles assembly for my own library. After rebuild the assembly appeared in references. Then i tried to add using of .Moles namespace and build the project but it failed with bunch of errors. Example with MDateTime didn't work

Can Tests be written in 3.5 MsTest Unit Test assemblies?

老子叫甜甜 提交于 2019-12-07 10:54:46
问题 Hi: I've enjoyed playing around with Pex and Moles...now it's time to use it in earnest to cover an legacy app as much as possible. We've started by converted to .NET 3.5 (the client can't yet host in .NET 4.0) We noticed that we are having trouble with getting Moles to work. Seems to work if the Test Project assembly is a .NET 4.0 -- but when converted the Unit Tests assembly framework back to .NET 3.5 (after installing Visual Studio 2010 SP1 to give that ability) it stops working. Keeps