Spodworld

a collection of technical fixes and other randon stuff

How to solve Message:No suitable constructor was found with Nunit tests in visual studio

This was appearing on a very simple unit test and no obvious stack trace was available and i couldn't debug/step into it.

The problem was that I had added a parameter to the constructor, and Nunit no longer had the default/blank constructor to call.

This is an example of a broken constructor 

 public AccountsServiceTests(string s)
            : base()
        {
        }

Removing the parameter will fix the problem like so...


 public AccountsServiceTests()
            : base()
        {
        }
Loading