title: Should every possible branch in a method have a separate junit?
body: <p>This is more of a design question.</p>
  
  <p>Suppose you have a method like this (as an example):</p>
  
  <pre><code>if (x == 5) {
    c = 1;
  } else {
   if (z != 2) {
    b = 6;
  } else {
     a = 3;
  }
  </code></pre>
  
  <p>Do you think it's best practice to have a junit for each possible branch? Ie, testx5, test xnot5znot2, testxnot5z2, etc, or something like:</p>
  
  <pre><code>void testMethod() {
  // x is 5
  test/assert code;
  
  // x not 5, z not 2
  test/assert code;
  
  // x not 5, z is 2
  test/assert code
  
  // etc
  }
  </code></pre>
  
  <p>EDIT: Just to be clear, my goal is complete code coverage. I just want to know opinions on whether I should make a new test for each branch or combine them in one test. Thank you for your input.</p>