How to define a set of input parameters in Pex?

Say I have MyClass with 100s of fields.If I use an object of MyClass as an input param, Pex would simply choke trying to generate all possible combinations (mine runs into 1000s of paths even on a simple test)[PexMethod]void MytestMethod(MyClass param){...}How can I tell Pex to use only a set of predefined objects of MyClass rather than having it trying to be smart and generate all possible combinations to test?In other words I want to manually specify a list of possible states for param in the code above and tell Pex to use itCheers...Read more

"Path bounds exceeded" while doing a Pex unit test

I am trying to generate a Pex unit test on an example program. I created a webpage with Default.aspx. Now I opened the default.aspx.cs file and added the below given code to the code behind:public int Add(int n1,int n2){return n1+n2;}public int Subtract(int n1,int n2){return n1-n2;} Now I right clicked inside the default.aspx.cs file, clicked "Run Pex". In the Pex exploration results I am getting a message "Path bounds exceeded".I don't understand – what does this mean and what should I do to get my unit test to pass?...Read more

Pex report PexAssumeFailedException in factory method

everyone! I am a beginner in unit testing. I'm now testing a project with visual studio 2010 and Pex, and I encountered the following problem.When I run the Pex Exploration, and Pex tell me "could not create an instance of Root.Reports.Type1FontData", and the details message Pex reported is:[TestMethod][PexGeneratedBy(typeof(FontDataTest))][Ignore][PexDescription("the test state was: assumption violation")]public void sGetTextLineThrowsPexAssumeFailedException500(){ string s; int i = 0; s = this.sGetTextLine((FontData)null, (string)...Read more

pex - 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....Read more

Which peers does DHT and PEX keep track of

I have a question regarding DHT and PEX. I have read a few articles that suggest that DHT updates other peers as to who is actively in a swarm a for a torrent. 1) When I have a torrent that's currently in a swarm, I check the DHT and PEX activity and shows that they are both active. I also see, for example, something like this: 124 seeds (124 seeds currently in swarm) 459 peers (235 in swarm).I always thought that DHT updates peers about other peers in a swarm. Thus, Where are the other 224 peers (ie 459-235= 224) coming from? Are these pe...Read more

intellitest - Pex: How to obtain all Path Conditions (PC)?

In possible to force Pex/Intellitest to look for any possible path condition? I need pex shows me those PC. In pexfonfun/visualstudio 2015, i can see only few PC. For example, infeasible PC aren't shown.In the next example i get 3 PC:1) i != 12 && i != 15;2) i == 15;3) i == 12;public static int foo(int i){ int a = 1; if(i == 12) a = 1; if(i == 15) a = 2; return a;}Why i dont get "i != 12 && i == 15"? Thanks! :)...Read more

While running PEX getting error

First of all - awesome job on PEX !!! We are trying to do code explorations for one of our Office Add-In project. So, first of all let me ask yo this - Is this is feasible ? In other words can PEX help me with Add-In/VSTO projects ?Secondly, I trying to execute PEX on one of our Add-In methods and got the following error--- Description runtime context Microsoft.Pex.Engine.Libraries.MicrosoftVisualBasicLibrary+ProjectErrorRuntimeContextAttribute+Context failed to openruntime context Microsoft.Pex.Engine.Libraries.MicrosoftVisualBasicLibrary+Proj...Read more

moles - Stub generation failes with obsolete attribute, Pex v0.94.51023.0

I have an interface with a method marked with the obsolete attribute. The attributes error parameter is set to true to throw an exception when used. The problem is this causes the stub to not generate for the whole class. When I alter the value to false the stub generates as expected.I’m looking for a way to generate the stub while retaining the error parameter as true.public interface ICar{ void Start(); [Obsolete("this is obsolete Stop, stop using it", true)] void Stop();}I’ve tried different permutations of.<Moles xmlns="http://s...Read more

Running Pex with .NET 3.5 projects

I'm currently trying to use Pex and Moles with a SharePoint 2010 solution that's written in .NET 3.5.When adding a test project (by using Pex -> Create parameterized tests) everything seems to work OK.However, when I try to compile I end up with a massive list of errors (missing namespaces and such) and warnings regarding referenced assemblies not being able to be resolved (such as System.Web which under .NET 4 is no single DLL anymore).This is due to the projects under test is .NET 3.5 and the Pex test project is .NET 4.0 as far as I understan...Read more

Can't see "Run Pex" in VS2010 after installation

I installed Pex on my Windows 7 machine (Visual Studio 2010 Pex 0.94.51023.0 Power Tools (x64) - (English)). However, when I right click on a piece of code in VS2010, I don't see the "Run Pex" option. When I open another project using VS2008, it is visible. Any idea why it the option does not show up in VS2010?...Read more

workaround pex internal class

Is there any way to make pex work when the classes under test are internal? how about sealed classes?I mean after all this type of tool is really good for API testing, you are likely to want to keep stuff at least internal sometimes.Thanks...Read more

PEX Home Run System

I am looking for insight. I am the 3rd owner of a single-story home built in the late 80s. It has 3/4" polybutylene (PB) plumbing running through the attic with 1/2" PB branching off. We have 2 full baths, and of course the kitchen, and 2 spigots outside. The laundry and water heater are located in the garage, near where the main water line enters. In all, I have 12 cold and 7 hot water fittings.Since 2014, I have had 5 pinhole leaks in various locations in the walls, at least 1 has caused flooring damage. I've had plumbers saying the house n...Read more

pex - What size manifold for 1" pipe from meter?

I am running all new water supply in an old house (c 1884). The incoming line from the meter is 1" galvanized (no idea how much mineral buildup is inside). Will it be sufficient to replace all of the plumbing using 3/4" manifolds (one hot & one cold) with 1/2" supplies to the fixtures? There is currently a mix of PVC, copper, and galvanized being used and water pressure at the fixtures is tolerable, but affected greatly by flushing toilets or running the washing machine. I would hope for better with a new system -is that likely?There are bo...Read more