title: How to test methods efficiently with JUnit
body: <p>My first method is simple, its just a <code>toString</code> which outputs 3 class specific fields</p>
  
  <pre><code>public String toString(){
      return String.format("%s/%s/%s",street,city,postcode);
  }
  </code></pre>
  
  <p>In JUnit it gives me this to form the tests on, I am unsure how to do this efficiently.</p>
  
  <pre><code>@Test
  public void testToString() {
      System.out.println("toString");
      Address instance = null;
      String expResult = "";
      String result = instance.toString();
      assertEquals(expResult, result);
      // TODO review the generated test code and remove the default call to fail.
      fail("The test case is a prototype.");
  }
  </code></pre>
  
  <p>I have done lots of research on JUnit and understand the concept of testing but can't quite get my head around how to do it with my code. Also how would I test this method efficiently, this is a method in a subclass which is the abstract method in the parent class</p>
  
  <pre><code>@Override
  int getDiscountRate() {
     return this.companyDiscount; 
  }
  </code></pre>
  
  <p>It gives me this to test</p>
  
  <pre><code>@Test
  public void testGetDiscountRate() {
      System.out.println("getDiscountRate");
      BusinessOrganisationDetails instance = null;
      int expResult = 0;
      int result = instance.getDiscountRate();
      assertEquals(expResult, result);
      // TODO review the generated test code and remove the default call to fail.
      fail("The test case is a prototype.");
  }
  </code></pre>