News

MSTest Framework Support in .NET/ASP.NET 1.0 Core RC 2

To smoothen the testing process for .NET Core 1.0 and ASP.NET Core 1.0 deployments, the Visual Studio team has released a preview of its MSTest Framework that supports the RC versions.

Microsoft's Visual Studio team has released a version of the MSTest Framework that now supports the RC2 versions of .NET Core and ASP.NET Core that were released recently. It's in preview at this point, so treat it accordingly (that is, don't assume it's ready for production use quite yet until you've done your own testing on your systems).

The MSTest Framework is Microsoft's framework developed for unit testing, and competes with third-party testing tools like the popular NUnit and xUnit. Some developers prefer MSTest because of its direct integration with Visual Studio and .NET Framework. MSTest is available on NuGet here.

A blog posted by Microsoft's Pratap Lakshman describes the process for using it, which involves installing the SDK, creating a class library project, adding references to MSTest in the runner and project.json file, and then writing and running tests. He writes that MSTest can also be used to test desktop .NET, which requires a slight change to the project.json file to reference it.

A few developers noted that tests didn't show up in the test runner when running MStest. The capitalization is key. As commenter Kris notes, "the value provided for 'testRunner' is 'MSTest', which apparently gets concatenated into dotnet-test-MSTest. However, if you look in your C:\Users\{username}\.nuget\packages\dotnet-test-mstest\1.0.0-preview\lib\net451 — you'll see the executable is dotnet-test-mstest." Lakshman verifies that to be the case (no pun intended).

Lakshman, in response to another commenter, notes that MStest also can be used with UWP. He replies that it essentially is a matter of replacing "Microsoft.VisualStudio.TestPlatform.UnitTestFramework;" with "Microsoft.VisualStudio.TestTools.UnitTesting;" in a unit test app template. Laksham said that he'll be following up with a more comprehensive post describing the process at a later time.

About the Author

Michael Domingo is a long-time software publishing veteran, having started up and managed several developer publications for the Clipper compiler, Microsoft Access, and Visual Basic. He's also managed IT pubs for 1105 Media, including Microsoft Certified Professional Magazine and Virtualization Review before landing his current gig as Visual Studio Magazine Editor in Chief. Besides his publishing life, he's a professional photographer, whose work can be found by Googling domingophoto.

comments powered by Disqus

Featured

  • Compare New GitHub Copilot Free Plan for Visual Studio/VS Code to Paid Plans

    The free plan restricts the number of completions, chat requests and access to AI models, being suitable for occasional users and small projects.

  • Diving Deep into .NET MAUI

    Ever since someone figured out that fiddling bits results in source code, developers have sought one codebase for all types of apps on all platforms, with Microsoft's latest attempt to further that effort being .NET MAUI.

  • Copilot AI Boosts Abound in New VS Code v1.96

    Microsoft improved on its new "Copilot Edit" functionality in the latest release of Visual Studio Code, v1.96, its open-source based code editor that has become the most popular in the world according to many surveys.

  • AdaBoost Regression Using C#

    Dr. James McCaffrey from Microsoft Research presents a complete end-to-end demonstration of the AdaBoost.R2 algorithm for regression problems (where the goal is to predict a single numeric value). The implementation follows the original source research paper closely, so you can use it as a guide for customization for specific scenarios.

  • Versioning and Documenting ASP.NET Core Services

    Building an API with ASP.NET Core is only half the job. If your API is going to live more than one release cycle, you're going to need to version it. If you have other people building clients for it, you're going to need to document it.

Subscribe on YouTube