I just shipped a test build of xUnit.net add-in at GitHub, which enables Visual Studio for Mac to run xUnit unit test cases.
Nov 09, 2020 Visual Studio for Mac testing tools can help you and your team develop and sustain high standards of code excellence. Unit tests can be written and run using the Microsoft unit test framework (MSTest), xUnit, or NUnit. Jul 14, 2020 Visual Studio includes the Microsoft unit testing frameworks for both managed and native code. However, Test Explorer can also run any unit test framework that has implemented a Test Explorer adapter. For more information about installing third-party unit test frameworks, see Install third-party unit test frameworks Run tests in Test Explorer.
So what are the steps to build such an add-in? Below I try to show some technical details.
Visual Studio for Mac
Microsoft announced this new IDE last year at Connect 2016 keynote, which is a surprise for many developers. But if we check this IDE further, easily we can see it is not a surprise at all.
- This IDE is based on MonoDevelop/Xamarin Studio, which has a very long history already.
- It reuses many useful ingredients from Visual Studio itself, such as the editor experience.
Extension Authoring
Previously to develop extensions for MonoDevelop/Xamarin Studio, we need to target the 5.x or 6.x profiles of MonoDevelop core binaries. That’s why for xUnit.net add-in there are two branches, 5.0 and 6.0.
The core assemblies have significant differences in editor related APIs, due to the big upgrade in Xamarin Studio 6.x. And now again, Visual Studio for Mac (based on MonoDevelop 7.x) requires a new branch.
So to create a new add-in, you can always get start from the official guide for Xamarin Studio,Extending Xamarin Studio with Add-Ins
Replace all texts of “Xamarin Studio” with “Visual Studio for Mac”, and you should be able to get Addin Maker (>=1.3.4) installed and a sample add-in created.
Note that MonoDevelop.Addins NuGet package should be upgraded to 0.3.9 and above, so that debugging add-ins can be enabled.
Finally to pack up your add-in and share with others, go to the assembly output folder to locate the add-in assembly (MonoDevelop.XUnit.dll
for example), and call vstool.exe
utility
Visual Studio For Mac Community
Then a .mpack
file would be generated and everyone can manually add it to Visual Studio for Mac once you share it publicly.
Note that once the add-in repository for Visual Studio for Mac is alive, you don’t need to share .mpack
file in this way.
Visual Studio C++ For Mac
Now Microsoft/Xamarin has opened up the addin feed for Visual Studio for Mac, so as publisher you should use http://addins.monodevelop.com to publish your addin. Users then use the integrated Extension Manager to search and install.