Profiling unit tests using Nunit
Published 28 August 2014
Can ANTS Profiler provide performance and memory profiling results for assemblies under unit testing by NUnit?
ANTS Profiler can profile a unit test. The method for doing this is to set ANTS Profiler to profile a .NET desktop application, then choose the path to NUnit-gui.exe. Once ANTS Profiler starts NUnit for you, you can load your test assembly and run your unit test. During the unit test, you can take snapshots from ANTS Profiler, and profiling will stop when NUnit's window is closed.
Please note that if your NUnit installation is configured to use "Shadow Copy", ANTS Profiler may return incomplete results. If this happens, use NUnit's Tools->options menu to disable shadow copy.
It would also be possible to profile the console version on NUnit in the same fashion. In addition to choosing nunit-console.exe as the application to profile, specify the name of the assembly to load and the appropriate options in the Arguments box.