I'm running Visual Studio 2017 Mac version 7.3 (build 764). The tests run from the Unit Test pad just fine (green circle and console output happens if I add output), but the debugger doesn't break when I set a breakpoint or expicitly throw an exception in the test. NUnit tests against.net core project in Visual Studio for Mac causing freezes, Unable to debug and unrelaiable Unit Tests view. Reported by Jeremy Connor Jun 26, 2017 at 04:46 AM visual studio for mac debugger.
Document your code
(I’ve learnt a lot more since I originally wrote this (for instance, how to debug your tests), so this is an updated version). This weekend I was part of a team that took part in the annual Hack Manchester hackathon (and we won Best in Show! How to Unit Test using Visual Studio for Mac (it's easy!) July 06, 2017 — 3 min read — 0 Comments Last month at the AkronCodeClub they selected the magic square kata, which was a new one for me. Using F5 in Visual Studio to debug unit tests Instead of executing NUnit runner and attaching to the process using Visual Studio, it's better to configure yout test project to start the NUnit test runner and debug your tests.
Every project on GitHub comes with a version-controlled wiki to give your documentation the high level of care it deserves. It’s easy to create well-maintained, Markdown or rich text documentation alongside your code.
Sign up for free See pricing for teams and enterprisesThe easiest way to get started is to install the NUnit Templates extension for Visual Studio. It will add project templates for the various Xamarin platforms.
For more general information, see Testing Xamarin Projects using NUnit 3.
- How do I run NUnit in debug mode from Visual Studio? Ask Question. Up vote 113 down vote favorite. When I need to debug my NUnit tests, I simply attach to the NUnit GUI application nunit-agent.exe using 'Debug|Attach to Process' and run the tests from the GUI. Any breakpoints in my tests (or the code they're testing) are hit.
- The settings is the same as using the Visual Studio Test/Test Settings/Keep Test Execution Engine running. DumpXmlTestDiscovery and DumpXmlTestResults These settings are used to dump the output from NUnit, as it is received by the adapter, before any processing in the adapter is done, to disk.
Getting started
In your solution;
- Add new test projects to your solution. These project types are included in the NUnit Templates Extension
- NUnit 3 Test Project (Android)
- NUnit 3 Test Project (iOS)
- NUnit 3 Test Project (Universal Windows)
- Write your unit tests in this project, in a portable project, or in a shared project, referencing the project with the tests.
- Build and run the tests on your device or emulator
If you tests are in a separate portable project, note that:
- You need to add that assembly to the
NUnit.Runner.App
in the startup code
- Your portable project must reference the same NUnit Framework version as your nunit.xamarin version, e.g. if using nunit.xamarin 3.01, reference nunit.framework 3.01.
The startup code for each platform is as follows;
Android
MainActivity.cs
iOS
AppDelegate.cs
Windows 10 Universal
Visual Studio For Mac Os
MainPage.xaml
MainPage.xaml.cs
App.xaml.cs
Copyright (c) 2018 The NUnit Project - Licensed under CC BY-NC-SA 4.0