title: Writing a JUnit test case for a constructor
body: <p>I have an assignment for school that involves learning how to use JUnit4. I need to make sure this constructor works properly, however, I am unsure of how to do so. There is a getter for the balance, so testing whether or not the constructor works with this is pretty easy, however, I don't know how to write a test case that involves user and pass as these do not have getters. Do I write a case for each individual parameter? Writing cases for methods that return a value hasn't been too difficult but I am clueless in terms of writing one for this constructor. Thanks!</p>
  
  <pre><code>public class BankAccount {
  
      // Starting balance
      private float balance = 0.0f;
      // Username and password
      private char[] username = null;
      private char[] password = null;
  
  
      public BankAccount(float balance, char[] user,char[] pass) {
          this.balance = balance;
          this.username = user;
          this.password = pass;
      }
  }
  </code></pre>