pex

Stub generation failes with obsolete attribute, Pex v0.94.51023.0

强颜欢笑 提交于 2019-12-12 01:49:55
问题 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

Moles v0.94 Causing Tests To Ignore Config File

我怕爱的太早我们不能终老 提交于 2019-12-11 16:11:34
问题 I've been using Moles v0.91 for at least a year, with hundreds of tests written and executed daily. After upgrading to v0.94, tests that run under the Moles host are no longer able to access the config file. These are tests that were otherwise working fine a few days earlier. The error message for each of these tests plainly indicates that they were unable to access the config, for example to find a connection string. (Yes, I know good unit tests should not be accessing the database. Please

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

Testing Private Method using Pex

我的梦境 提交于 2019-12-11 07:22:56
问题 I want to use Pex and Moles in my project.I want to test Private method using Pex. Is anyone used Pex to test private method? If we can't test directly, Is there any workaround to test Private method? 回答1: This has been answered by Peli, one of Pex's authors: PEX will not work for private and protected methods and workaround pex internal class. A few of the alternatives: Don't test private methods. Re-design the logic you are testing to increase testability. Use InternalsVisibleToAttribute.

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

Create NUnit test cases automatically from Pex

為{幸葍}努か 提交于 2019-12-09 13:57:48
问题 I need to create the NUnit Test case automatically from my .Net Solution file. Morover this needs to be done , from command line. I heard Pex create test cases automatically. Let know 回答1: The following steps should get you there: Add a reference to Pex.NUnit.dll in your test project In your test project's AssemblyInfo.cs, add the attribute - [assembly: Pex.NUnit.PexNUnitPackage] Build your solution (either from Visual Studio or using msbuild from the command line) run Pex from the command

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

How can I get PEX to auto-generate unit tests?

自作多情 提交于 2019-12-07 16:36:29
问题 How I can get PEX to auto-generate unit tests in Visual Studio 2013? I can auto-generate unit tests with PEX in visual studio 2010 and the menu was found by right clicking in the function body. 回答1: We did not release a version for Visual Studio 2013. The good news is that you can now do that same auto-generation of unit tests in Visual Studio 2015 using the "Smart Unit Tests" feature. 回答2: For Visual Studio 2013, they do provide PEX framework (lightweight version) named as CodeDigger. But

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

While running PEX getting error

我只是一个虾纸丫 提交于 2019-12-06 11:12:40
问题 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 open runtime context