title: Unit testing a method that returns the smallest value of an array
body: <p>I have kind of a theoretical question. Given a method:</p>
  
  <pre><code>public int findSmallestArrayValue(int[] values){
  
      int smallest = values[0];
  
      for (int count = 0; count &lt; values.length; count++){
  
          if(values[count] &lt; smallest){
              smallest = values[count];
          }
      }
  
      return smallest;
  }
  </code></pre>
  
  <p>What would you potentially unit test here ? So far I have come up with:</p>
  
  <pre><code>    assertEquals(array.findSmallestArrayValue(new int[]{5,11,3,6,8}),3);
      assertEquals(array.findSmallestArrayValue(new int[]{5,5,5,5,5}),5);
      assertEquals(array.findSmallestArrayValue(new int[]{-1,2,3,4,5}),-1);
  </code></pre>
  
  <p>Now I ask myself, what else would be useful/possible ? For example I came up with:</p>
  
  <ul>
  <li>values that are larger than int, but Java won't let me do that ?</li>
  <li>empty array, how to do that ?</li>
  <li>filling up the int array with more values than int can take ?</li>
  </ul>
  
  <p>Especially what is actually useful and what is not ? What do you think ?</p>