I unity I have a function to call with wrong arguments and I want to make sure that the function throw the right exception with the right message. So my function call is this:
winDetector.DoMove(move)
And it should throw and exception like this:
throw new Exception("Move is not valid.");
Looks like I should use Assert.Throws<Exception>
but I don't know how. Now to both Unity and C#. How can I do this?
P.S. Assert.Throws<Exception>
is not the correct way. Please see my answer below.