mstest

Missing Method Exception When Referencing .Net Standard Project From .Net 4.6.1 Unit Test

荒凉一梦 提交于 2019-12-10 02:44:55
问题 I am getting the following exception when running a .Net 4.6.1 unit test that uses System.IO.Compression.ZipFile.Open , if the unit test project references a .Net Standard 2.0 assembly: System.MissingMethodException: Method not found: 'System.IO.Compression.ZipArchive System.IO.Compression.ZipFile.Open(System.String, System.IO.Compression.ZipArchiveMode)'. at UnitTestProject.UnitTest1.TestMethod1() The unit test project was created using the VS 2017 Unit Test project (not the .NET Core one)

Run SpecFlow tests without Visual Studio

戏子无情 提交于 2019-12-10 02:30:43
问题 I would like out QA team to be able to run SpecFlow tests. I would like them to be able to change values and append more scenarios. These appended scenarios will have matching step definitions, so they only need to modify the features. The QA team does not have access to Visual Studio. Is it possible to achieve this without using Visual Studio? We are currently using MS Test but we are willing to use NUnit if that will help. 回答1: Yes - there is a 'simple' way. Since SpecFlow merely generates

How do I get a Unit Test to copy my DLLs and other files when I run a test?

≡放荡痞女 提交于 2019-12-10 02:11:33
问题 I'm working on an application and I have created a number of unit tests for it. The project with the test class depends upon 3 third party DLLs. When I go to the bin\Debug folder for the test project, the Dlls are there. But when I run the test, the DLLs are not being copied into the TestResult\\Out folder. There is also a log4net.config file from another project that I would like to have copied. This one is not showing up in the test project's bin\Debug folder, so that's another issue I have

Why does Assert.AreEqual(1.0, double.NaN, 1.0) pass?

被刻印的时光 ゝ 提交于 2019-12-10 01:10:02
问题 Short question, why does Assert.AreEqual(1.0, double.NaN, 1.0) pass? Whereas Assert.AreEqual(1.0, double.NaN) fails. Is it a bug in MSTest (Microsoft.VisualStudio.QualityTools.UnitTestFramework) or am I missing something here? Best regards, Egil. Update: Should probably add, that the reason behind my question is, that I have a bunch of unit tests that unfortunately passed due to the result of some linear algebraic matrix operation being NaN or (+/-)Infinity. The unit tests are fine, but since

Resharper 7: MSTest not working - “Test wasn't run”

爷,独闯天下 提交于 2019-12-09 14:03:38
问题 Since I upgraded to VS2012 and Resharper 7, my previously working MS Tests are not running anymore. The tests are run in an ASP.NET environment. I use the following Attributes: [TestMethod] [HostType("ASP.NET")] [AspNetDevelopmentServerHost("C:\\Projekte\\****\\Website", "/")] [UrlToTest("http://localhost:7924/")] Any idea how to fix this? 回答1: As odd as it is, using VS2012, using Resharper 8.0, using NUnit, I was receiving this error because of an entry in my app.config file. I added an

Is it possible to test “internal” class from a c++ dll using MSTest?

旧街凉风 提交于 2019-12-09 10:12:14
问题 We are currently trying to add unit testing to our c++ application. The application is made of 30 projects that generate 29 dll and 1 exe. We use MSTest to run our unit test since it's already included in Visual Studio 2010. It works great for class that are declared "public". These class have this at the beginning: #ifdef RESEAU_IMPL #define CLASS_DECL _declspec(dllexport) #else #define CLASS_DECL _declspec(dllimport) #endif But for all the other class (90% of the code), they are not

MSTest Looking For DLL In Wrong Location

别等时光非礼了梦想. 提交于 2019-12-09 06:33:53
问题 I have a test harness running and it was failing to run due to Type not resolved, which more specifically was a SerializationException on a bad bind. I used fuslogvw to track down where it was looking for the DLL and not finding it and I'm confused as to why it is looking in the location it is: === Pre-bind state information === LOG: DisplayName = DavisVision.Common.Data, Version=3.1.0.34, Culture=neutral, PublicKeyToken=c410b32babd148a6 (Fully-specified) LOG: Appbase = file:///C:/PROGRAM

Convert Trx into Html using TRXER

柔情痞子 提交于 2019-12-09 00:32:36
问题 Just released a new tool called TRXER. Git link :https://github.com/NivNavick/trxer All it does is tramsform TRX file (mstest results file) into html. The Html as shown below is clean,nice and understandable. You can see the pie indicates statuses count and a table that includes test classes that contains the tests themselves. You can view the release note here https://github.com/NivNavick/trxer Hope you will love this product and find it useful. Best regards :) 回答1: Nice work! The "Show

Add custom message to unit test result

时光怂恿深爱的人放手 提交于 2019-12-08 23:13:20
问题 Is there a way I can add a custom message to the result of a test method? I want to put a stopwatch on part of the code to see how long its running. I don't need to test that it's running within a certain time frame, just want to see in the result window what the elapsed time was. 回答1: Assuming you are using MSTest, you can use System.Diagnostics.Trace.WriteLine("Hello World"); To output whatever you'd like. It will show up in the full results of the test runner. 回答2: The example above did

Visual Studio 2008 Test View Panel Not Showing All Tests

放肆的年华 提交于 2019-12-08 19:28:15
问题 I have a set of 6 MSTest test assemblies. When I bring up the Test View window and group by Project all of my projects show up save one. I cannot seem to make Visual Studio understand that this project is a unit test assembly. Resharper's Unit Test Runner has no problem identifying this sixth assembly. So the assembly is fine from that stand point. How does Visual Studio 2008 determine that an assembly is a unit test assembly? I have compared the csproj files and found nothing out of the