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

  • Full Stack Hands-On Development with .NET

    In the fast-paced realm of modern software development, proficiency across a full stack of technologies is not just beneficial, it's essential. Microsoft has an entire stack of open source development components in its .NET platform (formerly known as .NET Core) that can be used to build an end-to-end set of applications.

  • .NET-Centric Uno Platform Debuts 'Single Project' for 9 Targets

    "We've reduced the complexity of project files and eliminated the need for explicit NuGet package references, separate project libraries, or 'shared' projects."

  • Creating Reactive Applications in .NET

    In modern applications, data is being retrieved in asynchronous, real-time streams, as traditional pull requests where the clients asks for data from the server are becoming a thing of the past.

  • AI for GitHub Collaboration? Maybe Not So Much

    No doubt GitHub Copilot has been a boon for developers, but AI might not be the best tool for collaboration, according to developers weighing in on a recent social media post from the GitHub team.

  • Visual Studio 2022 Getting VS Code 'Command Palette' Equivalent

    As any Visual Studio Code user knows, the editor's command palette is a powerful tool for getting things done quickly, without having to navigate through menus and dialogs. Now, we learn how an equivalent is coming for Microsoft's flagship Visual Studio IDE, invoked by the same familiar Ctrl+Shift+P keyboard shortcut.

Subscribe on YouTube