mstest

wildcard test containers to mstest. exe

最后都变了- 提交于 2019-12-12 08:23:11
问题 Is it possible to pass wildcard testcontainer values to the command-line mstest.exe rather than manually hardcoding multiple testcontainer values? Such as Mstest.exe /testcontainer: tests .dll I'm wanting to manually invoke mstest in our tfs 2012 upgrade template.xaml build processso tthat it behaves like a autodiscovery way similar to running tests in default template.xaml If not could this be written into a bat script to loop through folders from a given start folder? 回答1: MSTest doesn't

How to fix 'Microsoft.NETCore.App', version '1.1.2' was not found?

心已入冬 提交于 2019-12-12 07:10:35
问题 I am seeing this error when I try to run unit tests: Testhost process exited with error: It was not possible to find any compatible framework version The specified framework 'Microsoft.NETCore.App', version '1.1.2' was not found. - Check application dependencies and target a framework version installed at: \ - Alternatively, install the framework version '1.1.2'. How to fix it? 回答1: Installing DotNetCore.1.0.5_1.1.2-WindowsHosting solved the problem for me and my collegues. 回答2: The error

Ms Test or NUnit?

不问归期 提交于 2019-12-12 05:49:45
问题 Is there any advantage to picking NUnit for unit/integration testing vs the built in MsTest? 回答1: They are pretty similar. Differences are subtle. NUnit has testcases for parametrized tests; MSTest does not. You can write [TestCase(1, "one)] [TestCase(2, "two)] [TestCase(3, "three)] [TestCase(4, "four)] public void CanTranslate(int number, string expectedTranslation) { var translation = _sut.Translate(number); translation.Should().Be.EqualTo(expectedTranslation); } rather than writing 4 tests

Run UnitTest several time - not just loop it

筅森魡賤 提交于 2019-12-12 04:57:46
问题 I have a VS UnitTest (MSTest) to cover some multiple threading code. With out the required locks the code fails the test 15 out 30 runs - i.e half the runs. I fix the code and the tests pass 30 times. Now I want the test framework to run the test N time and not just once to be sure that it cant pass once out of luck. There doesn't seem to be any way to do that with an attribute on the test so I put a loop INSIDE the test to run the test code body N times. I remove the fixes to the code (locks

what test data approach/framework is recommended for .net unit testing

坚强是说给别人听的谎言 提交于 2019-12-12 04:34:45
问题 what test data approach/framework is recommended for .net unit testing? I'm in VS2010, C#, doing business logic layer testing. By approaches I mean like: creating database snapshots, programmatically creating each time, etc etc. Like what approach to use to ensure at the start of each test the database is in a known state. 回答1: Some would say that if you're using the database, then you're doing functional testing, not unit testing. 回答2: This is not directly related to database testing. But in

If creating files from code that is exercised via Tests is disallowed, how can such methods be tested?

人盡茶涼 提交于 2019-12-12 03:48:36
问题 I'm trying to test a method from a Test project like so: [TestMethod] public void TestEmailGeneratedReport() { List<String> recipients = new List<string>(); recipients.Add("bclayshannon@hotmail.net"); recipients.Add("axx3andspace@male.edu"); recipients.Add("cshannon@PlatypiRUs.com"); bool succeeded = RoboReporterConstsAndUtils.EmailGeneratedReport(recipients); Assert.IsTrue(succeeded); } ...but it blows up; I get, " Could not find a part of the path. " It works fine, though, when I call it

How to execute a line of code which is a data setup code in MSTest before all test

断了今生、忘了曾经 提交于 2019-12-12 03:44:23
问题 I have a very uncommon scenario. I have a function, lets call this as DataGenerator. This method generates all test XMLs which are needed for the tests to execute. These XMLs are referenced as data source in each of the MSTests. [TestMethod] [TestCategory("UITest"), TestCategory("PersonalDetailsFlow")] [DataSource("Microsoft.VisualStudio.TestTools.DataSource.XML", "|DataDirectory|\\TestFlows.xml", "flow", DataAccessMethod.Sequential)] public void TestMethod1() { //Test Code } And I use the

Sending arguments to Developer Command Prompt for Visual Studio

烈酒焚心 提交于 2019-12-12 02:58:23
问题 I am not able to pass some parameters to my Dev cmd prompt for vs, I can do it with the classic cmd but not with this one. And I need it because I want to execute CodedUITests from an executable. This is what my code looks like: String Path = @"C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Microsoft Visual Studio 2012\Visual Studio Tools\Developer Command Prompt for VS2012.lnk"; ProcessStartInfo proc = new ProcessStartInfo(); proc.FileName = Path; proc.UseShellExecute = true; proc

vstest executionengine error pdbs missing

一曲冷凌霜 提交于 2019-12-12 02:55:13
问题 I'm running VS2013 premium and it's built-in testing engine. Earlier today is started throwing the following errors for any test. I've tried re-starting VS bu that didn't help, any ideas? 'vstest.executionengine.x86.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_32\mscorlib\v4.0_4.0.0.0__b77a5c561934e089\mscorlib.dll'. Cannot find or open the PDB file. 'vstest.executionengine.x86.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\PROGRAM FILES (X86)

MSTest Visual Studio 2012 and AppDomain

喜夏-厌秋 提交于 2019-12-12 02:41:45
问题 I have noticed that the MSTest is launching assemblies tests in separate AppDomain. Are we able to configure MSTest to avoid creating new AppDomain for each test assembly? 回答1: You can run it with /noisolation - "Run tests within the MSTest.exe process. This choice improves test run speed but increases risk to the MSTest.exe process." http://msdn.microsoft.com/en-us/library/ms182489.aspx 来源: https://stackoverflow.com/questions/19561802/mstest-visual-studio-2012-and-appdomain