Proper test output when building with Cake, NUnit and TeamCity

You've just migrated to Cake for building your freshly upgraded NUnit test project, but TeamCity won't run your tests. Here's how to fix it.

Migrating your project to build with Cake, only to find your tests now just output "Success" even if you know your unit tests should fail, like shown below?

Without this fix, TeamCity will not correctly report the number of tests in your build run.
"Success" may just hide failing tests, since they were not actually run.

After all, given this very simple step in Cake, there's not much room for things to fail, right?

When using Cake to build your project, with the DotNetCoreTest command, you have to include the TeamCity.VSTest.TestAdapter nuget package, as well as the Microsoft.NET.Test.SDK.

This should ensure the tests actually run and report correctly to TeamCity:

TeamCity now correctly displays the amount of succeeding and failing tests.
Ah, correctly reporting about failed tests.