mstest

How to get MSTest to find my test data files?

可紊 提交于 2019-12-03 01:12:16
I have a few tests that need to be fed with external data from excel files. The files are included in the test project, and in Visual Studio, I have edited the test settings file (Local.testsettings) to deploy the data files. This makes it work fine i VS. We are, however, also running continous integration with TeamCity, and in TeamCity this doesn't work. My data files are unavailable to the test. Seems that the tests are run from a temporary folder named "C:\TeamCity\buildAgent\temp\buildTmp\ciuser_AS40VS6 2009-12-11 09_40_17\Out", and the data files are not copied there. I have tried

How can I reset an EF7 InMemory provider between unit tests?

孤街浪徒 提交于 2019-12-03 00:54:32
I am trying to use the EF7 InMemory provider for unit tests but the persistent nature of the InMemory database between tests is causing me problems. The following code demonstrates my issue. One test will work and the other test will always fail. Even though I set the _context to null between tests the second test run will always have 4 records in it. [TestClass] public class UnitTest1 { private SchoolContext _context; [TestInitialize] public void Setup() { Random rng = new Random(); var optionsBuilder = new DbContextOptionsBuilder<SchoolContext>(); optionsBuilder.UseInMemoryDatabase();

Running native VS2012/C++ 64-bit unit tests from command line

丶灬走出姿态 提交于 2019-12-02 23:03:07
I'm attempting to run unit tests from the command line. I tried using the mstest.exe program using the following command: E:\VS Projects\...\>"C:\Program Files (x86)\Microsoft Visual Studio 11.0\ Common7\IDE\MSTest.exe" /testcontainer:mytest.dll /testsettings:"E:\VS Projects\...\Local.testsettings" The mstest program responce was: Microsoft (R) Test Execution Command Line Tool Version 11.0.50727.1 Copyright (c) Microsoft Corporation. All rights reserved. Loading E:\VS Projects\...\Local.testsettings... Loading mytest.dll... mytest.dll Unable to load the test container 'mytest.dll' or one of

Recommendations for Continuous integration for Mercurial/Kiln + MSBuild + MSTest

南楼画角 提交于 2019-12-02 22:38:54
We have our source code stored in Kiln/Mercurial repositories; we use MSBuild to build our product and we have Unit Tests that utilize MSTest (Visual Studio Unit Tests). What solutions exist to implement a continuous integration machine (i.e. Build machine). The requirements for this are: A build should be kicked of when necessary (i.e. code has changed in the Repositories we care about) Before the actual build, the latest version of the source code must be acquired from the repository we are building from The build must build the entire product The build must build all Unit Tests The build

Getting MSTest output to show in CruiseControl.Net

懵懂的女人 提交于 2019-12-02 21:23:09
I currently have our build server set up with CruiseControl.Net running a build using MSBuild and then running unit tests using MSTest. The problem is I can't see the output of the unit tests in CC - I know they are being run because I can get the build to fail if I commit a failing test. I have followed the online guides from http://blogs.blackmarble.co.uk/blogs/bm-bloggers/archive/2006/06/14/5255.aspx and http://www.softwarepassion.com/?p=89 but still having no luck. My ccnet.config file contains <tasks> <msbuild> <executable>C:\WINDOWS\Microsoft.NET\Framework\v3.5\MSBuild.exe</executable>

How to integrate MSTest in your TeamCity build process

情到浓时终转凉″ 提交于 2019-12-02 21:06:25
How do I run MSTest as part of my build process in TeamCity? What are the pitfalls? This answer is specifically for TeamCity 7.1 on Windows, but may apply to other environments. In your TeamCity build configuration, on the General Settings page Artifact paths : Artifacts\MSTest => MSTest Create a new Command Linebuild step Custom script : if not exist Artifacts\MSTest mkdir Artifacts\MSTest Create a new MSTestbuild step List assembly files : **\bin\**\*.Tests.dll Results file : Artifacts\MSTest\testResults.trx Pitfalls Using wildcards when specifying which test assemblies to run You can use

Chromedriver is extremely slow on a specific machine using Selenium Grid and .net

夙愿已清 提交于 2019-12-02 20:22:27
Overview: Chromedriver works normally on one machine but extremely slowly on two other identical machines. Setup: Selenium Webdriver using .Net for coding and Selenium Grid for distributing the tests. MSTest is being used from within Visual Studio 2010 in order to run the tests. A 64bit Windows 7 local machine acting as the Hub Three 32-bit Win 7 remote machines (two of them are virtual) on my local network all configured as nodes. Here is the command used to start the nodes on the remote machines: java -jar c:\seleniumWebDriver\seleniumGrid\selenium-server-standalone-2.31.0.jar -role node

MSTest executing all my tests simultaneously breaks tests - what to do

那年仲夏 提交于 2019-12-02 19:02:58
Ok, this is annoying. MSTest executes all of my tests simultaneously which causes some of them to fail. No this is not because my tests are fragile and susceptible to build order rather it is because this is a demo project in which I use a Db4o object database running from a file. So I have a couple of DataAccess tests checking that my repositories work correctly and boom, MSTest blows up. Since it tries to run all its tests at the same time it gets an error when a test tries to access the database file while other tests are using it. Can anyone think of a quick way around this? I don't want

Visual Studio 15.8.1 not running MS unit tests

依然范特西╮ 提交于 2019-12-02 17:52:39
When I updated Visual Studio to the latest version, 1 of my test projects stopped running tests and outputted this message: Test project {} does not reference any .NET NuGet adapter. Test discovery or execution might not work for this project. It is recommended to reference NuGet test adapters in each test project in the solution. UPDATED: I was using MS Test as opposed to any other test frameworks like Nunit or Xunit. Ok, you can add Nuget packages as asked. But you can also try to disable the following setting (Tools->Options->Test): "For improved performance, only use test adapters in test

Visual Studio 2010 does not discover new unit tests

二次信任 提交于 2019-12-02 17:52:11
I am writing some unit tests in Visual Studio 2010. I can run all tests by using "Run all Tests in Current Context". However, if I write a new unit test, it does not get picked up by the environment - in other words, I am not able to find it in Test List Editor, by running all tests, or anywhere else. If I unload the project and then reload it; the new test is available to run. When I am adding a unit test, I simply add a new method to an already existing TestClass and decorating it with [TestMethod] attribute - nothing fancy. What might be causing this behaviour, and how do I make it work ? I