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
61
votes
1 answer

How to tell Pex not to stub an abstract class that has concrete implementations

I'm trying to use Pex to test some code. I have an abstract class with four concrete implementations. I have created factory methods for each of the four concrete types. I had also created one for the abstract type, except as this nice thread…
Andrew
  • 14,325
  • 4
  • 43
  • 64
28
votes
6 answers

C# - What does "\0" equate to?

I am playing with Pex and one of the parameters it passes into my method is "\0". What does that mean? My guess is an empty string ("") based on the content of my method. However, if it is the same then why not just use "" instead of "\0"? Anyone…
Vaccano
  • 78,325
  • 149
  • 468
  • 850
15
votes
3 answers

How to use "Pex and Moles" library with Entity Framework?

This is a tough one because not too many people use Pex & Moles or so I think (even though Pex is a really great product - much better than any other unit testing tool) I have a Data project that has a very simple model with just one entity…
Robert Koritnik
  • 103,639
  • 52
  • 277
  • 404
11
votes
6 answers

Anyone using Moles / Pex in production?

I did search the forum and did not find a similar question. I'm looking to make a final decision on our mocking framework of choice moving forward as a best practice - I've decided on Moq... untill I just recently discovered MS has finally created a…
dferraro
  • 6,357
  • 11
  • 46
  • 69
9
votes
3 answers

Why would I select Moles as my mocking framework?

I've been looking at several Mocking frameworks for ASP.NET and came across Microsoft Moles. This seems to be a part of Microsoft Research team and was wondering If anyone here has selected Moles over other matured Mocking frameworks such as Moq.
user300981
  • 1,423
  • 5
  • 13
  • 16
6
votes
4 answers

Moles 0.94.51023.0 error on VS 2010 SP1

I'm trying to mole System.ServiceModel v4 in VS 2010 SP1 with Moles 0.94.51023.0 and I keep getting the following errror: The type or namespace name 'IHttpCookieContainerManager' does not exist in the namespace 'ssm::System.ServiceModel.Channels'…
Nick Nieslanik
  • 4,388
  • 23
  • 21
6
votes
3 answers

Syntax Comparison between Moq and Rhino mocks

My company is trying to decide if we are going to standardize on Moq, Rhino Mocks or MS Moles and Stubs. I know Rhino Mocks and Moles and Stubs fairly well. But I am unfamiliar with Moq. How does the syntax work? Does it support Arrange Act…
Vaccano
  • 78,325
  • 149
  • 468
  • 850
6
votes
2 answers

Moling DataContext with MS Moles?

How can I mole the DataContext that I'm using in a class to write messages to a table. I'd like to assert that the table LINQ is writing to has the expected count of messages. Here's what i have so far. var context = new…
devployment
  • 2,121
  • 1
  • 22
  • 33
5
votes
1 answer

Pex and F# in Visual Studio 2010 Ultimate

I have been trying using Pex in a F# project but I have faced several issues on which I would appreciate some help: Visual Studio Pex addin worked for half an hour and not for complex project exploration. After that each time I run a Pex…
Nicolas
  • 51
  • 1
5
votes
3 answers

Using Moles with XUnit - wrong dll version

I'm trying to set up Moles to use in our unit testing. We are using xunit, so I am using the Xunit extension that comes with moles (Microsoft.Moles.Framework.Xunit). However, as we are running Xunit 1.7, Moles is complaining that I am not running…
Smashery
  • 57,848
  • 30
  • 97
  • 128
5
votes
2 answers

Integrate Pex with MoQ

Can anyone point me to a resource that shows an example of how Pex can be used in conjunction with MoQ? Thanks
DotnetDude
  • 11,617
  • 35
  • 100
  • 158
5
votes
2 answers

Moles without Pex?

Can Moles be used without having to use Pex? Also, Does anyone know when MS Moles will have a Release candidate? I am hesitant of using it in the Production system without knowing which direction it will head.
DotnetDude
  • 11,617
  • 35
  • 100
  • 158
5
votes
2 answers

What to put as the Provider for a mocked IQueryable

I am working with Moles and mocking a System.Data.Linq.Table. I got it constructing fine, but when I use it, it wants IQueryable.Provider to be mocked (moled) as well. I just want it to use normal Linq To Objects. Any idea what that would be? Here…
Vaccano
  • 78,325
  • 149
  • 468
  • 850
4
votes
1 answer

Warning of could not resolve Moles dlls on Build server

We are using moles 0.94 for some tests in our solution. However, every time it gets first compiled, the build server will raise a couple of warnings: C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets (1360): Could not resolve…
geekysteven
  • 113
  • 1
  • 6
4
votes
1 answer

How to unit test network connections?

I want to unit test the code below. I've been working with MSTest and I tried to learn Microsoft Moles and RhinoMocks. But I couldn't make neither of them help me. I know I can change the code drastically to use interfaces that make it more…
Jader Dias
  • 88,211
  • 155
  • 421
  • 625
1
2 3 4 5 6