mstest

Running MStest in cruise control .net build server

こ雲淡風輕ζ 提交于 2019-12-01 04:58:31
I'm trying to setup cruisecontrol.net to work with our existing projects. The projects use the visual studio 2008 testing tools (running as .net 2.0). During the actual build process I get several error messages, most or which are: Type 'TestClass' is not defined. I'm assuming that this is because I don't have the testing framework installed on my build server. I'd rather not just copy bits from my dev machine (that always feels a bit hacky) and I'd also rather not install visual studio on the build sever (that seems like overkill). Does anyone know where I can get a standalone installer to

VSTS Build fails running NUnit tests

◇◆丶佛笑我妖孽 提交于 2019-12-01 04:42:44
问题 When building a visual studio solution using visual studio team services it runs the unit tests, written in nunit 3 using the nunit 3 NUnit3TestAdapter it starts running the tests. The error it gives is: Error: Illegal characters in path. The complete output as follows 2016-02-11T17:02:40.8514411Z Executing the powershell script: C:\BuildAgent\tasks\VSTest\1.0.29\VSTest.ps1 2016-02-11T17:02:41.1483135Z ##[debug]Calling Invoke-VSTest for all test assemblies 2016-02-11T17:02:41.2108131Z Working

Which version of VS should I install to allow unit testing on the build server?

╄→гoц情女王★ 提交于 2019-12-01 04:38:38
问题 Since a few weeks we have our first TFS (2013) setup. The setup is rather small and there are only a handful (read: 10) developers that will have to work with it for the time being. It was setup as a "test" to see if it fits within our organisation. Now, we'd also like to test the build server functionality. We've configured the build server and enabled a single agent. The MSDN then states that "You must install on the build agent the version of Visual Studio that your team uses on its dev

Mock HttpClient using Moq

佐手、 提交于 2019-12-01 04:11:10
I like to unit test a class that use HttpClient . We injected the HttpClient object in the class constructor. public class ClassA : IClassA { private readonly HttpClient _httpClient; public ClassA(HttpClient httpClient) { _httpClient = httpClient; } public async Task<HttpResponseMessage> SendRequest(SomeObject someObject) { //Do some stuff var request = new HttpRequestMessage(HttpMethod.Post, "http://some-domain.in"); //Build the request var response = await _httpClient.SendAsync(request); return response; } } Now we like to unit test the ClassA.SendRequest method. We are using Ms Test for

Using MSTest, xUnit or NUnit with dotnet core

陌路散爱 提交于 2019-12-01 04:04:00
问题 TLDR - Jump to the answer for details on a working xUnit or MSTest setup. xUnit was the least painful option. I've been unable to get NUnit working on my build server so I've resorted to trying both xUnit and MSTest - Neither have worked for me. MSTest I just dont get - I expected this to work but when I try to install dotnet-test-mstest from nuget I get dependency issues as all of it's dependent libraries are not compatible for netcoreapp1 for example.... The dependency MSTest.ObjectModel 1

Running MStest in cruise control .net build server

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-01 03:19:10
问题 I'm trying to setup cruisecontrol.net to work with our existing projects. The projects use the visual studio 2008 testing tools (running as .net 2.0). During the actual build process I get several error messages, most or which are: Type 'TestClass' is not defined. I'm assuming that this is because I don't have the testing framework installed on my build server. I'd rather not just copy bits from my dev machine (that always feels a bit hacky) and I'd also rather not install visual studio on

Visual Studio Test Project - Does not copy folder on deployment

一个人想着一个人 提交于 2019-12-01 03:08:33
Here is the problem: 1. Create a TestProject in your Visual Studio solution. 2. Open the .testrunconfig file and under the 'deployment' menu item, select the 'Enable Deployment' checkbox. 3. Now click on 'Add Directory...' button and add a folder which has some files in it. 4. Run the test project (use a dummy test). Ok, now go check the TestResults folder: You will see that all the files got directly copied (to the top level)- the folder itself is not copied (with the files under them). This messes up my paths during testing. Can anybody tell how to get the folder copied instead of just the

Resharper Unit Test Runner Can't Find Content Files

做~自己de王妃 提交于 2019-12-01 03:07:20
I have some tests that rely on some files I have marked as "Content" and to "Always Copy". I'm using the DeploymentItem attribute to make sure they get copied to the output directory when running mstest outside of VS. However when using the Resharper test runner inside VS these files never make it to the directory that it is executing from. Anyone know how to fix this? Disabling the Unit Testing > Shadow-copy assemblies being tested Resharper option fixed this problem for me. We solved this problem by marking the test files as embedded resources and then used a utility method to read the

How to use MsTest in Continuous Integration without VS?

对着背影说爱祢 提交于 2019-12-01 02:46:10
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 ? Ruben Bartelink 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 installer in 2010 ). UPDATE: See this post from Steve Smith for more info which says pretty

Mock HttpClient using Moq

三世轮回 提交于 2019-12-01 01:37:09
问题 I like to unit test a class that use HttpClient . We injected the HttpClient object in the class constructor. public class ClassA : IClassA { private readonly HttpClient _httpClient; public ClassA(HttpClient httpClient) { _httpClient = httpClient; } public async Task<HttpResponseMessage> SendRequest(SomeObject someObject) { //Do some stuff var request = new HttpRequestMessage(HttpMethod.Post, "http://some-domain.in"); //Build the request var response = await _httpClient.SendAsync(request);