title: How to unit test a method with invalid parameters?
body: <p>I would like to test if i pass invalid parameters to my function it throws an excepction or something.</p>
  
  <p>my function to test would be for example:</p>
  
  <pre><code>       public int addTwoNumbers(int a, int b){
           return a+b;
         }
  </code></pre>
  
  <p>so in junit if i call the function like:</p>
  
  <pre><code>      Number number = new Numbers();
        int result = number.addTwoNumber("string", 3);
  </code></pre>
  
  <p>it will throw an exception because of the "string" parameter.</p>
  
  <p>How could i unit test this function? </p>