title: assertTrue and assertFalse in same JUnit test
body: <p>This is my 1st post! </p>
  
  <p>I would like to use both <code>assertTrue(boolean)</code> and <code>assertFalse(boolean)</code> in the same test  using JUnit4. I am using Parameterization, so I would like to include parameters that will fail the test, to verify that they do infact fail.</p>
  
  <p>The method that I am testing accepts a String, checks if the string is in an acceptable currency format (numbers only, no letters, max 2 digits after a decimal point), and returns a HashMap with 2 keys: VALID which is a boolean denoting the strings validity as a currency, and FORMATTING which is a String added to the original valid String to ensure all valid Strings end up with a decimal point and exactly 2 digits thereafter. Invalid strings will not be formatted.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>@RunWith(value = Parameterized.class)
  public class CheckCurrencyFormatTest {
  
  private String input;
  private String output;
  
  @Parameters
   public static Collection&lt;String[]&gt; data() {
     String[][] data = {
          {"1", "1.00"}               //return true
          ,{"1.", "1.00"}             //return true
          ,{"1.0", "1.00"}            //return true
          ,{"1.00", "1.00"}           //return true
          //,{"1.000", "1.000"}         //return false
          //,{"m","m"}                  //return false
      };
     return Arrays.asList(data);
   }
  
  public CheckCurrencyFormatTest( String input, String output) {
      this.input = input;
      this.output = output;
  }
  
  @Test
  public void testCheckString() {
      CheckCurrencyFormat ccf = new CheckCurrencyFormat();
      HashMap hm;
      boolean valid;
      String resultString;
  
      valid = false;
      resultString = "";
      hm = ccf.checkString(input);
      for (Object key : hm.keySet()) {
          if ("VALID".equals(key.toString())){
              valid = Boolean.parseBoolean(hm.get(key).toString());
          }
          if ("FORMATTING".equals(key.toString())){
              System.out.println(input + " and add " + hm.get(key).toString());
              resultString = input+(hm.get(key).toString());
          }
      }
      assertTrue(valid);
      //assertFalse(valid);
      assertEquals(output, resultString);
  }
  </code></pre>
  
  <p>The tests run successfully with the following lines commented out: <code>,{"1.000", "1.000"}</code>and <code>,{"m","m"}</code> and <code>assertFalse(valid);</code></p>
  
  <p>Thank you kindly.</p>