Questions tagged [pex-and-moles]

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.

85 questions
2
votes
2 answers

Has anyone made moles work properly?

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…
Puterdo Borato
  • 388
  • 4
  • 19
2
votes
0 answers

Moles and Binding Redirects

The scenario I have is pretty common, one nuget package is using V1.0 and another is using V1.1 so I had to add a Binding Redirect. However, the moles runner appears to be ignoring the binding redirect in both the App.config and assembly config…
Red Knight
  • 279
  • 2
  • 7
2
votes
2 answers

Launching xunit tests from ReSharper under Moles

I have got xunit tests working great; launching them from ReSharper. Now I'm trying to use moles for some test cases. I've got my [Moles] attribute on the test, with a reference to the moles xunit extension, and yet it's complaining that "Moles…
Smashery
  • 57,848
  • 30
  • 97
  • 128
1
vote
1 answer

Does Microsoft Moles Framework generate code coverage

I have a simple test project using Moles and I have check the flag in the test settings to create code coverage but the Moles tests do not generate code coverage. I'm not using Pex. Does Microsoft Moles Framework generate code coverage? Thanks
Steve
  • 11
  • 1
1
vote
1 answer

Moles with InternalsVisibleTo creates "Assembly reference invalid" warning

Another year, another question about Moles. I've got an assembly with an internal sealed class that I'd like to mole in the test project that I use for unit tests. According to the Moles documentation I should add an [assembly: InternalsVisibleTo(…
Gorgsenegger
  • 7,356
  • 4
  • 51
  • 89
1
vote
1 answer

Visual Studio - Exclude moles files from search

I know Visual Studio allows you to specify what kinds of files you want to search in the find and replace dialog, which works well in general. Generated moles files, however, have a path ending in "m.g.cs". When searching for .cs files, these are…
Syllepsis
  • 449
  • 4
  • 13
1
vote
1 answer

What are the reasons for Moles not to generate delegates for some functions?

I seem to have this perplexing issue with Moles not generating delegates, for some instance methods. Instead of showing the exact method (Although I will denote that it's a web service proxy method, with a myriad of attributes prepending it's…
PsyFish
  • 287
  • 1
  • 9
1
vote
0 answers

Does Microsoft Moles support .NET Compact Framework?

I am currently working on unit tests for a WinCE-based application which uses .NET Compact Framework 2.0. I could like to know, does Moles Framework support .NET Compact Framework 2.0? If not, could someone please suggest another mocking framework…
1
vote
1 answer

Moles and internal classes

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…
Mike
  • 1,297
  • 2
  • 14
  • 22
1
vote
1 answer

The key 'Moles' cannot be found

I create a unit-test project for my solution and I'm using Moles to detour all data reading. When today I launch all tests, at end the result was an error like this "the hosttype "Moles" cannot be loaded: The key 'Moles' cannot be found." for every…
devT
  • 21
  • 4
1
vote
1 answer

Not able to read ConfigurationManager.AppSettings on HostType("Moles")

If HostType as Moles, then i can't get data via ConfigurationManager.AppSettings Its work fine for me 2-3 months before. But it is not worked and all my test cases are failed (raised the null reference exception). Please help me to fix.…
Hasan K
  • 129
  • 1
  • 4
1
vote
0 answers

Why Moles picks up SharePoint.Behaviors for .NET v4.0 when all the rest is v3.5?

I have a ClassLibrary accessing SharePoint 2010 object model as part of a bigger SP 2010 Sandbox solution. All projects target .NET v3.5 (not client profile). Then there's a ASP.NET WebApplication project used to test the ClassLibrary - still .NET…
superjos
  • 12,189
  • 6
  • 89
  • 134
1
vote
0 answers

Moles Generation - Same Class name in Different Name space

This question was originally asked here: http://social.msdn.microsoft.com/Forums/en-US/pex/thread/60972f1f-735a-474e-be84-40cda8006ffa?prof=required. I've recently installed Moles for VS2010. I have assembly that has same classes (same name) but…
user935291
  • 11
  • 2
1
vote
1 answer

Can't create Mole for System.Environment class

I want to replace behavior of Environment.GetFolderPath in my unittest, but after generation moles for System assembly, System.Moles assembly does not contain definition of type MEnvironment.
Eduard Kibort
  • 316
  • 1
  • 7
1
vote
2 answers

Moles does not show new Method Signatures after Changes in Class

I had class Voo { private static AnotherClass Doo(int id) { //do some stuff with id then return object of AnotherClass return x[0]; } } and used this private with moles MVoo.DooInt32 = delegate ... NOW I changed the method…
user799821
  • 218
  • 2
  • 10