mstest

How can I copy the stdout of a process (copy, not redirect)?

安稳与你 提交于 2019-12-20 03:26:30
问题 there are a lot of examples that show how to redirect the stdout of another application. However I would like to let the application keep its stdout and only retrieve a copy of the stdout in my parent process. Is this possible? My scenario: I have some tests (using Visual Studio Test Runner) which start an external process (server) to do their testing. The server outputs a lot of useful debug information in its stdout which I would like to include in my test results. I can capture the process

DotCover shows only unit test source code not production code

社会主义新天地 提交于 2019-12-20 02:39:09
问题 I'm starting to use dotCover. I have a set of Debug compiled dlls + their pdbs. Then I've created a test project and executed resharper on it to see the coverage. What I'm getting is the coverage only of the unit test project instead of the whole coverage: I expected to find on the coverage tab the dlls referenced from my unit tests and their coverage. Am i right? Maybe I'm missing something or am I doing something wrong? 回答1: You can try to uncheck the "Match coverage results with current

Debugging MSTest Unittests in VisualStudio Code

旧街凉风 提交于 2019-12-20 01:39:28
问题 I am trying to use Visual Studio Code to Debug a MSTest unit test project. But the tests just run and the breakpoint is never reached. Here is my launch.json: { "version": "0.2.0", "configurations": [ { "name": ".NET Core Test (console)", "type": "coreclr", "request": "launch", "preLaunchTask": "build", "program": "C:\\Program Files\\dotnet\\dotnet.exe", "args": ["test"], "cwd": "${workspaceRoot}", "console": "internalConsole", "stopAtEntry": false, "internalConsoleOptions":

Unit Testing .NET 3.5 projects using MStest in VS2010

南笙酒味 提交于 2019-12-20 01:13:55
问题 There's a bug/feature in Visual Studio 2010 where you can't create a unit test project with the 2.0 CLR. https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=483891&wa=wsignin1.0 This causes all sorts of problems when the project being tested is targetting the 2.0 CLR (ASP.NET MVC 2 on top of .Net 3.5 SP1 in this case) - crashes on debug, tests failing unexpectedly, in one case the test project doesn't even build because of the dependency on System.Web 2.0.0.0

How can I precisely time a test run in visual studio 2010

一世执手 提交于 2019-12-19 19:29:20
问题 I have a suite of unit tests for my project which I run using the visual studio test runner. I want to know how long the test run takes when it runs. The test run details screen shows me the start and end times of the run, but only to the nearest second. My test suite at the moment is taking less than a second to complete, so I can't tell if my suite of 50 tests is taking < 0.1 second (good!) or up to 1 second (bad!). Is there any way to enable this level of precision? 回答1: In your root

MSTest: “File extension specified '.dll' is not a valid test extension”

浪尽此生 提交于 2019-12-19 17:38:32
问题 I have a test project in VS2010, and I need to run the unit tests from command line. On one machine the following scenario works just fine: 1) Build the tests via "MSBuild test_project.csproj" 2) Run the tests via "MSTest /testcontainer:test_project.dll" But on the other machine the 2nd step produced a weird error message, namely: "File extension specified '.dll' is not a valid test extension" Any idea how to tackle this? Thanks! 回答1: Check the registry on a PC that has Visual Studio 2010

Code coverage for async methods

旧时模样 提交于 2019-12-19 16:54:43
问题 When I analyse code coverage in Visual Studio 2012, any of the await lines in async methods are showing as not covered even though they are obviously executing since my tests are passing. The code coverage report says that the uncovered method is MoveNext , which is not present in my code (perhaps it's compiler-generated). Is there a way to fix code coverage reporting for async methods? Note : I just ran coverage using NCover, and the coverage numbers make a lot more sense using that tool. As

Failed to queue test run: Unable to start the agent process(Visual Studio 2010)

社会主义新天地 提交于 2019-12-19 07:26:07
问题 While trying to run all the unit tests in my solution(Visual Studio 2010) I am getting a 'Failed to queue test run xxxx@MACHINENAME 2010-06-23 14:01:36': Unable to start the agent process' error. Does anyone know what causes this particular error to occur and how to resolve it so that I can run my unit tests? Thanks 回答1: I don't know if this is still the case for Visual Studio 2010, but you could have this same scenario in Visual Studio 2008. When breaking off a unit test run (i.e. when

How to use MsTest in Continuous Integration without VS?

老子叫甜甜 提交于 2019-12-19 05:15:24
问题 I my problem is quite simple, i have a CI server wich run msbuild and mstest. The problem is that the Microsoft.VisualStudio.QualityTools.UnitTestFramework.dll doesn't exist( and i thinks other file related to mstest...) if we don't install VS in the server wich is pretty stupid for a CI server... Anybody have a solution about this problem ? 回答1: Unfortunately, there is no supported or easy way around having to install VS on the build agent machine in 2005 or 2008 (There will be a test agent

How to re-deploy, re-create database on each test run

巧了我就是萌 提交于 2019-12-19 03:01:54
问题 Currently I'm using Visual Studio 2012 RC and SQL Server 2012 RTM. I'd like to know how to re-deploy/re-create a test database for each test run. Keep in mind I've a SQL Server database project for the database using Visual Studio 2012's template. Actually I'm not very sure about an idea I got in my mind, but .testsettings file has Setup and cleanup scripts . Is this the way to go? For example, a PowerShell script reading the database project generated script and executing it against the