pex-and-moles developed by Microsoft research team. Pex being an exploration tool explores and provides random inputs to the method in test to go in every branch of that code. Moles being an isolation framework isolates the code to be tested from all dependencies.
Questions tagged [pex-and-moles]
85 questions
0
votes
1 answer
Moles and licensing using file licenses.licx
I have problem with moles and file licenses.licx. I searched over internet, but haven't found a helping answer.
The problem is, that we are using licensed third party product library which needs license key stored in file licenses.licx. Let's call…

Jan Rucka
- 1
- 1
0
votes
1 answer
How can I get an MSDN Moles tutorial to build?
I have an unusual question. I need help in understanding an original poster's own answer to his 6-month-old query on the MSDN forums.
The OP was told to ask further questions on StackOverflow, so there's no point in asking the OP to clarify his…

OldGrantonian
- 597
- 1
- 8
- 23
0
votes
2 answers
No mole class for NativeMethods.cs?
I have a class named NativeMethods.cs which contains all extern methods:
internal static class NativeMethods
{
[DllImport("kernel32.dll", SetLastError = true, CallingConvention = CallingConvention.Winapi)]
[return:…

Ian
- 5,625
- 11
- 57
- 93
0
votes
1 answer
Unit testing and DB isolation via pex and moles
I have a VS winforms project which has lot of database calls.
Whenever i create unit testing, there is more number of methods, taking more time to consume and more number of unit test projects.
How do i isolate DB calls or will i be able to isolate…

Sharpeye500
- 8,775
- 25
- 95
- 143
0
votes
1 answer
Generate A Moles Stub
I'm new to Pex and Moles and i want to make use of parametrized unit tests. I am using constructor injection and I want to create a moles stub for my parameter.
public UserLogic(IUserRepository userRepository)
{
_userRepository =…

ministrymason
- 1,783
- 2
- 20
- 33
0
votes
1 answer
What classes have methods which Moles can redirect?
I've seen samples using Moles to redirect DateTime.Now but when I tried to redirect System.Net.Sockets.TcpClient.GetStream I couldn't make the corresponding MTcpClient appear on Intellisense.
Is there a limited number of classes which methods Moles…

Jader Dias
- 88,211
- 155
- 421
- 625
0
votes
1 answer
Pex and Moles with MVC 3?
I was wondering if anyone has an opinion on whether it's worth it to spend much (any?) time obtaining and working with Pex and Moles, particularly for MVC 3 projects?
I found this link:
Does Pex/Moles work with MVC? Anyone have any positive…

jbizzle
- 1,495
- 2
- 11
- 11
0
votes
1 answer
Using Microsoft Moles with static variables
I have following code
public class SampleClass
{
static string sampleString = GetString("sample");
public static string GetString(string p)
{
return DatabaseInteraction.GetData(p);
}
}
public…

Ashwani K
- 7,880
- 19
- 63
- 102
0
votes
1 answer
PexChoose non generic methods
Is there any way to specify the return type for PexChoose at runtime? For example PexChoose.Value(name, Type)?
This would be useful to make general models that generate values of different types depending on runtime contraints.

Marius P
- 1
- 1
0
votes
1 answer
Moles and Stubs on build server
I'm trying to get our team to use Moles and Stubs primarily to Mole out static classes. One thing I need to find out is do I have to install moles and stubs using the installation program on my build servers? Or can I just deploy the dependencies…

dalcantara
- 1,613
- 2
- 21
- 35
0
votes
1 answer
Help with the Moles syntax for testing private method with generics
I've got a signature for a method that looks like this:
private IEnumerable BuildCustomerUpdatePlan(List localCacheChangedCustomers, List crmChangedCustomers){}
When I look at the moled object, the syntax (IntelliSense) of how to call the method and…

Andrew Connell
- 4,939
- 5
- 30
- 42
0
votes
1 answer
Microsoft Moles HostType errors in TFS 2010 Lab Management environment
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…

Nick Nieslanik
- 4,388
- 23
- 21
0
votes
1 answer
Can't Create Mole Type for System.Diagnostics.EventLog
I am building (yet another) Windows Service, using TDD and Moles. This project includes extensions to System.Dagnostics.EventLog, tot include details of the input parameter Exception object in the log message. I must verify the exception details…

Mike Christian
- 1,526
- 1
- 15
- 27
0
votes
1 answer
Pex not satisfying code contract
I'm trying to wrote a pex test, and I noticed that it always was feeding a false value as one of the params that I wanted. My test looked like this (simplified: there are/were more params, but otherwise no different):
[PexMethod]
public void…

Steven Evers
- 16,649
- 19
- 79
- 126
0
votes
1 answer
Moles "conflict" when using Moles with MsTest
I have found an explicable (but frustrating) behavior when working with Moles and MsTest.
Just imagine the following case:
"Test DLL A" is using Moles on mscorlib
"Test DLL B" is using Moles on mscorlib
To improve compilation time, in both cases…