mstest

Export test results from Test Explorer visual studio 2013

可紊 提交于 2019-12-10 17:23:20
问题 I want to find a solution to export my test results from test explorer to TFS or any other format like excel. I saw some posts bases on .trx file. In test results folder of my project I have a folder generated each time I run a test with 2 sub folders IN and OUT . The IN folder is always empty and OUT folder contains AgentRestart.dat file. If I run my whole test suite I can only see number of passed and failed tests in Test Explorer. To find out result of each test case and store I need to

Unit testing features missing for .NET Core in VS 2019 and Visual Studio Installer?

a 夏天 提交于 2019-12-10 15:54:18
问题 I just added a MSTest .NET Core unit test project to a solution in VS 2019 but there now don't appear to be any features for adding a new unit test file to that project. Missing Add > Unit test... context menu option Steps to reproduce missing context menu issue: In Visual Studio 2019, add a new 'MSTest Project (.NET Core)' project to an existing solution Right click on the name of the new test project in Solution Explorer See if the option for 'Add > Unit test...' is present? That option,

All invocation on the mock must have a corresponding setup

你。 提交于 2019-12-10 15:49:00
问题 I have some legacy code I want to unit test. I created a first moq test but I am getting the following exception: Moq.MockException:IConnection.SendRequest(ADF.Messaging.Contract.ConfigServer.GetDataVersionRequest) invocation failed with mock behavior Strict. All invocations on the mock must have a corresponding setup. Important pieces of code: Property on class: Public Property Connection() As IConnection Get Return _connection End Get Set(ByVal value As IConnection) _connection = value End

Unity Error: The given assembly name or codebase was invalid

感情迁移 提交于 2019-12-10 15:28:24
问题 I am using the microsoft unity frame work and getting this error: ********** 4/15/2012 9:46:08 AM ********** Inner Exception Type: System.IO.FileLoadException Inner Exception: The given assembly name or codebase was invalid. (Exception from HRESULT: 0x80131047) Inner Source: mscorlib Inner Stack Trace: at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMarkHandle stackMark, Boolean loadTypeFromPartialName,

All invocation on the mock must have a corresponding setup when setting string parameter

放肆的年华 提交于 2019-12-10 14:16:47
问题 I have a simple method I am testing. When I run the test I get the error "All invocation on the mock must have a corresponding setup" on the last line dataField.DefaultValue = orderNumber.ToString(); What would cause this? I am just setting a field. void IUtilities.SetOrderIdInDocumentMetaData(Document document, int orderNumber) { DataField dataField = null; if (document.DataFields.IsPresent(ORDER_ID) == false) { dataField = document.DataFields.Add(ORDER_ID, AppDefault: false, DocDefault:

Running MsTest from the command line with a custom assembly base directory

橙三吉。 提交于 2019-12-10 13:35:42
问题 I did quite a lot of research on the web and tried a few settings, but I couldn't reproduce the behavior of running MsTest in Visual Studio 2012 on the command line. Our solution consists of many projects that build to the same bin folder residing at the solution level (e.g. C:\MySolution\bin) - this is the code-under-test (CUT). The tests are grouped in a separate project that resides in its own solution and builds in its own bin folder (e.g. C:\MySolution\Tests\bin). There are really a lot

Using MSTest with F#

孤人 提交于 2019-12-10 13:32:54
问题 Is it possible to use MSTest with F# in VS2010. People has asked this question many times. But I can't seem to find a solution among the answers. Has anybody been able to use MSTest for F# unit testing or should I stick to NUnit? 回答1: I think you should stick to NUnit. Have a look here: http://connect.microsoft.com/VisualStudio/feedback/details/564586/make-using-mstest-more-accessible-to-f-projects. There is no progress with that issue. 回答2: Yes, you can use MsTest with F# in VS2010. At the

MSTest setting Apartment Threading to MTA

北城以北 提交于 2019-12-10 13:31:02
问题 I'm using MSTest in Visual Studio 2010 on a project that needs the apartment threading model set to MTA. I've looked online and the items I've found and tried seem to only work with Visual Studio 2008 and 2005, see http://blogs.msdn.com/b/ploeh/archive/2007/10/21/runningmstestinanmta.aspx. Thanks 回答1: You're right, most of the information online is out of date. I eventually found Microsoft's documentation: How to: Run Unit Tests in MTA mode You need to open your .testsettings file in an XML

Unit Testing Error - “Unable to get type” “Error: Could not load type” “from assembly”

那年仲夏 提交于 2019-12-10 13:27:30
问题 I am getting this error with my new unit test: Unable to get type MyTestProject.MyTestClass, MyTestProject. Error: Could not load type 'MyTestProject.MyTestClass' from assembly 'MyTestProject'.. I have other tests in the project that were working just fine and now they are all showing a similar error message. If I run the test in Resharper (rather than the built in Visual Studio Test runner) then it works fine. (I would just use that, but it is slower.) Any idea what this could mean? 回答1: It

Command Line Arguments with Visual Studio Unit Testing C#

不打扰是莪最后的温柔 提交于 2019-12-10 13:07:59
问题 I'm supposed to use the VS unit testing framework to ensure all code is working correctly. However I'm having A LOT of trouble getting tests that require command line arguments to work (since command line inputs must be given at runtime...and with unit tests there is no real "runtime"). Is there a way to run my unit tests with command line argument inputs? I realized this is not the ideal way to construct a program, but I unfortunately do not decide how the testing process works. I've read