mstest

Visual Studio 2013 is unable to open the Test Window

会有一股神秘感。 提交于 2019-12-28 16:45:05
问题 When I open Visual Studio 2013 and load my solution I'm greeted by an error message telling me the Test Window is unable to load. The composition produced a single composition error. The root cause is provided below. Review the CompositionException.Errors property for more detailed information. 1) Cannot compose part 'Microsoft.VisualStudio.TestWindow.Controller.TestsServiceInternal' because a cycle exists in the dependencies between the exports being composed. To break this cycle, consider

Exclude auto properties from Code Coverage in Visual Studio 2015

两盒软妹~` 提交于 2019-12-28 15:50:10
问题 I just upgraded a bunch of projects to VS2015/C#6. Now MSTest's Code Coverage analysis is reporting that some auto properties aren't covered by unit tests. This wasn't the case in Visual Studio 2013, and I suspect it may be something to do with the new autoproperty features in C#6. Dealing with all the false-positives this generates rather defeats the purpose of the Code Coverage tool as it makes it practically impossible to identify actual code lacking test coverage. We don't want to write

Can I use mstest.exe without installing Visual Studio?

做~自己de王妃 提交于 2019-12-28 03:17:13
问题 I want to use mstest.exe to run my unit test on build server, but I don't want to install Visual Studio on the build server. Can I just install MSTest without Visual Studio? 回答1: It is possible to run mstest.exe without visual studio. Download one of the Agents for Visual Studio ISO's below and install the Test Agent on the server: Visual Studio 2017 (127MB disk space, less than that for download) Visual Studio 2015 (128MB setup, 2GB disk space required) Visual Studio 2012 (224MB) Visual

How do I use Assert to verify that an exception has been thrown?

限于喜欢 提交于 2019-12-27 11:35:09
问题 How do I use Assert (or other Test class?) to verify that an exception has been thrown? 回答1: For "Visual Studio Team Test" it appears you apply the ExpectedException attribute to the test's method. Sample from the documentation here: A Unit Testing Walkthrough with Visual Studio Team Test [TestMethod] [ExpectedException(typeof(ArgumentException), "A userId of null was inappropriately allowed.")] public void NullUserIdInConstructor() { LogonInfo logonInfo = new LogonInfo(null, "P@ss0word"); }

Running .webtest tests results in “.webtest is not a valid extension”

↘锁芯ラ 提交于 2019-12-24 19:42:01
问题 I'm using VS2017 - is there any way to get webtests working without installing VS2017 Enterprise? All I need is mstest.exe - not the GUI or IDE. 回答1: No, for unit test you can install Agents For Visual Studio 2017. But for Web Load & Performance Testing, it is only supported in Visual Studio Enterprise 2017, So you need to install Visual Studio Enterprise 2017 with Web Performance and Load testing tools. More information about VS 2017 supported features, you can refer to: Compare Visual

MSTest - DeploymentItem attribute unavailable on windows store test project

折月煮酒 提交于 2019-12-24 13:14:19
问题 As the title says - I can't find a way of including a file with a windows store test project. (A standard .NET test project works fine) Right click on the solution and execute : Add new project -> C# -> Windows Store -> Unit test library (Windows store apps) You get this boilerplate, to which I have added the DeploymentItem attribute: using System; using System.Collections.Generic; using System.Linq; using System.Text; using Microsoft.VisualStudio.TestPlatform.UnitTestFramework; namespace

Error related to Microsoft.VisualStudio.TestTools.UnitTesting namespace

人走茶凉 提交于 2019-12-24 10:38:27
问题 I am developing a windows store app which take the user input(mathematical question),process it using prolog and output the answer. I have add Microsoft.VisualStudio.QualityTools.UnitTestFramework.dll as an reference to my windows Store app. I refer https://github.com/SWI-Prolog/contrib-swiplcs/blob/master/TestSwiPl/PlQuery.cs This reference creates two errors, 1.Cannot resolve Assembly or Windows Metadata file 'System.Configuration.dll' 2.Type universe cannot resolve assembly: System

c# unit test with common code repeated [duplicate]

淺唱寂寞╮ 提交于 2019-12-24 08:57:29
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: What would be an alternate to [SetUp] and [TearDown] in MSTest? I'm learning how to use Unit Testing and automated testing in general and have a few questions I can't figure out/find the answer to I currently test by having multiple [TestMethod]s that call various methods and have asserts in them. Right now the TestMethod's all have duplicate code to hit a DB and set themself up for the rest of the test. An

unit test fails in r# but passes in mstest

落爺英雄遲暮 提交于 2019-12-24 08:56:47
问题 I'm getting the error below when running Unit Tests in R#, but the tests pass as expected in Visual Studio MSTest, this is occurring with anything that touches the entity framework, other tests work without a problem, i thought this was because a dll was not deployed but made sure that all the dll's are marked as deploy local = true, also made sure that profiling is turned off as I read that this might cause issues with R#, the exception is pretty strange, can't really find any rhyme or

Configuring MsTest with TeamCity

ぃ、小莉子 提交于 2019-12-24 08:19:22
问题 I'm using TeamCity with a Git repository and MSTest. The step running the tests gives the following error: [Step 4/4] No assemblies, run configuration and test metadata were found [Step 4/4] Process exited with code 1 So the assembly path seems to be wrong. To execute the tests I need to specify the assembly path, what I don't understand, is where my dll is supposed to be ? The Git repository does not contain the bin folder of the project, must I add it to Git ? Is there a place the dll is