package edu.pdx.cs410J;

import org.junit.Test;

import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.Matchers.equalTo;

public class InvokeMainTest extends InvokeMainTestCase {

  @Test
  public void commandLineArgsWrittenToStandardOutAreCaptured() {
    String[] args = { "One", "Two", "Three"};
    MainMethodResult result = invokeMain(InvokeMainTest.class, args);
    assertThat(result.getExitCode(), equalTo(0));

    String out = result.getTextWrittenToStandardOut();
    for(String arg : args) {
      assertThat(out, containsString(arg));
    }
  }

  public static void main(String... args) {
    for (String arg : args) {
      System.out.println(arg);
    }

    System.exit(0);
  }
}

Add a new test so that we do not have an empty set of unit tests. That situation now causes the build to fail.
Add a new test so that we do not have an empty set of unit tests.  That situation now causes the build to fail.
