title: Unity unit tests - Check if the function call with an argument throws an exception
body: <p>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:</p>
  
  <pre><code>winDetector.DoMove(move)
  </code></pre>
  
  <p>And it should throw and exception like this:</p>
  
  <pre><code>throw new Exception("Move is not valid.");
  </code></pre>
  
  <p>Looks like I should use <code>Assert.Throws&lt;Exception&gt;</code> but I don't know how. Now to both Unity and C#. How can I do this?</p>
  
  <p>P.S. <code>Assert.Throws&lt;Exception&gt;</code> is not the correct way. Please see my answer below.</p>