mstest

Visual Studio 2013 MSTest vs NUnit

此生再无相见时 提交于 2019-11-29 19:48:02
My company is upgrading our Visual Studio 2012 to 2013 Premium. In the midst of this, we are also looking to start automating our tests using Visual Studio Team Services I have read a couple of MSTest vs nUnit posts and articles in the past but most of it compares the older version of MSTest. Also, nUnit had a lot of favourable reviews as compared to MSTest. My question is, considering Microsoft's commitment towards the ALM, Agile practices and all the new stuff they've added into VS2013 Premium and Visual Studio Team Services to facilitate and encourage automated testing, how does MSTest

VS 2010 Test Runner error “The agent process was stopped while the test was running.”

我与影子孤独终老i 提交于 2019-11-29 19:07:22
In Visual Studio 2010, I have a number of unit tests. When I run multiple tests at one time using test lists, I sometimes reveive the following error for one or more of the tests: The agent process was stopped while the test was running. It is never the same test failing, and if I try to run the test again, it succeeds. I found this bug report on Connect , which seems to be the same problem, but it does not offer a solution. Has anyone else seen this behaviour ? How I can avoid it ? Edit I am still experiencing this bug, and so is many of my colleagues on the same software/hardware setup. I

How to refresh UIMap object in CodedUI

人盡茶涼 提交于 2019-11-29 17:40:44
Can i refresh UIMap object ? Problem is I change the location of UI element on and I again try to get the AutomationElement at that time I get AutomationELment but its BoundingRectanle is infinity. So i am assuming that it is not refreshing the UIMap object. Can anyone please help me on this ? In the UIMaps section of your test, you have probably something like: private MyTestUIMap uiMap; public MyTestUImap UIMap { get { if (this.uiMap == null) { this.uiMap = new MyTestUIMap(); } return this.uiMap; } } This creates a singleton for the UIMap object the first time it is used. To refresh it, you

MSTest - How to limit test result folders

会有一股神秘感。 提交于 2019-11-29 16:28:30
问题 Every time an MSTest runs it creates a new time stamped folder inside of TestResults . This can result in many files/folders that take up hard drive space. Is there a way to configure MSTest to overwrite the contents of the TestResults folder so that is only contains results from the most recent run? 回答1: You can limit the number of stored test-runs to 1, which should meet your requirements. MSDN have an article on how to achieve this: In Visual Studio, click Options on the Tools menu. The

Interacting with multiple instances of an application in Coded UI

霸气de小男生 提交于 2019-11-29 16:03:27
The scenario that I am facing is that I am trying to write a single test which will use Coded UI to interact with multiple instances of the same application, in this case Microsoft Excel. In other words, there will be multiple Excel workbooks open in multiple windows, and I need to be able to direct Coded UI to interact with a specific instance programatically. I initially thought this type of instance management would be a function of the ApplicationUnderTest class, but it is not obvious how this class would achieve this. The interactions will involve the same UIMap for all instances (in fact

Issue with Code Coverage in VS 2012

半腔热情 提交于 2019-11-29 14:02:10
I have a simple ASP.Net MVC 4 application with 3 simple tests. Each of these tests run successfully to completion, however the Code Coverage window gives me the following error: Empty results generated: No binaries were instrumented. Make sure the tests ran, required binaries were loaded, had matching symbol files, and were not excluded through custom settings. For more information see http://go.microsoft.com/fwlink/?LinkID=253731 I have done some research but nothing has resolved my problem to date. I know the tests run I have .pdb files in the same location as my .dll I am not optimsing by

MsTest DeploymentItem OutputDirectory in testsettings

故事扮演 提交于 2019-11-29 13:49:34
How can I specify output directory when I create DeploymentItem in testsettings? It is easy when you apply DeploymentItem attribute to method or class (there is a special constructor parameter) but I don't see a way to apply it in testsettings (and even UI doesn't contain anything like this). Try editing the testrunconfig file either from VS or using an XML editor - right-click and choose open with and add a line like this one: <Deployment> <DeploymentItem filename="rootdir\SomeDir\" outputDirectory="SomeDir" /> In visual studio 2010: Go to Test Edit Test Settings .testsettings Go to

MSTest cannot find the assembly

夙愿已清 提交于 2019-11-29 13:19:35
I was using MSTest and i use command mstest /testsettings:local.Testsetting /testcontainer:folder\obj\Debug\test.dll and this is the output, Run has the following issue(s): Warning: Test Run deployment issue: The assembly or module 'Microsoft.Practices. Prism' directly or indirectly referenced by the test container 'test.dll' was not found. Warning: Test Run deployment issue: The assembly or module 'Project.Common.dll' directly or indirectly referenced by the test container 'test.dll' was not found. Warning: Test Run deployment issue: The assembly or module 'Project.Infrastructure.dll'

How to prevent expected exceptions from breaking the debug test run?

纵饮孤独 提交于 2019-11-29 09:35:00
When running MSTEST unit tests in debug mode, the execution stops in every expected exception that is thrown. My test looks like this [TestMethod()] [ExpectedException(typeof(ArgumentNullException))] public void ShouldThrowExceptionWhenPassingNull() { object data = null; target.CheckNull(data); } the target method looks like this: public void CheckNull(object data) { if (ReferenceEquals(null, data)) { throw new ArgumentNullException("data"); } } // test run breaks here: ArgumentNullException was unhandled by user code Did you try running the tests using ctrl-R ctrl-T instead of ctrl-R T ? EDIT

Run tests in 64-bit

。_饼干妹妹 提交于 2019-11-29 09:22:26
I got a ADO.NET driver which is compiled as 64-bit. I therefore need to run mstests in 64-bit mode. Is that possible? (the dev machine is 64bit). Visual Studio has a built in option for this. It was a bit hard to find (if you do not know where to look). Doubleclick on the local.testsettings file in Solution Explorer and select Hosts in the listbox. Then change as the image shows. You must do your tests in a 64-bit OS and your application should be compiled with AnyCPU . Try the solution described in this blog post : Backup mstest.exe and run CorFlags.exe MSTest.exe /32BIT- /Force to remove the