title: Trying to write unit test cannot work it out?
body: <p>Write a unit test for <code>addInventory()</code>. Call <code>redSweater.addInventory()</code> with parameter <code>sweaterShipment</code>. Print the shown error if the subsequent quantity is incorrect. Sample output for failed unit test given initial quantity is 10 and <code>sweaterShipment</code> is 50:</p>
  
  <blockquote>
    <p>Beginning tests. UNIT TEST FAILED: addInventory() Tests complete.Note:
    UNIT TEST FAILED is preceded by 3 spaces.</p>
  </blockquote>
  
  <pre><code>  // ===== Code from file InventoryTag.java =====
    public class InventoryTag {
      private int quantityRemaining;
  
      public InventoryTag() {
        quantityRemaining = 0;
      }
  
      public int getQuantityRemaining() {
         return quantityRemaining;
      }
  
      public void addInventory(int numItems) {
        if (numItems &gt; 10) {
           quantityRemaining = quantityRemaining + numItems;
        }
      }
    }// ===== end =====
  
  
  
     // ===== Code from file CallInventoryTag.java =====
      public class CallInventoryTag {
         public static void main (String [] args) {
             InventoryTag redSweater = new InventoryTag();
             int sweaterShipment;
             int sweaterInventoryBefore;
  
             sweaterInventoryBefore = redSweater.getQuantityRemaining();
             sweaterShipment = 25;
  
             System.out.println("Beginning tests.");
  
             // FIXME add unit test for addInventory
             System.out.println("Tests complete.");
         }
  
       }// ===== end =====
  </code></pre>