Package com.sandwich.koan.cmdline

Examples of com.sandwich.koan.cmdline.CommandLineArgumentRunner


  }
 
  @Test
  public void passingSuites() throws Throwable {
    stubAllKoans(Arrays.asList(new OnePassingKoan(), new OnePassingKoanDifferentName()));
    new CommandLineArgumentRunner().run();
    assertSystemOutContains(Strings.getMessage("passing_suites")+": OnePassingKoan, OnePassingKoanDifferentName");
  }
View Full Code Here


  }
 
  @Test
  public void failingSuites() throws Throwable {
    stubAllKoans(Arrays.asList(new OneFailingKoan(), new OneFailingKoanDifferentName()));
    new CommandLineArgumentRunner().run();
    assertSystemOutContains(Strings.getMessage("remaining_suites")+": OneFailingKoan, OneFailingKoanDifferentName");
  }
View Full Code Here

  }
 
  @Test
  public void failingAndPassingSuites() throws Throwable {
    stubAllKoans(Arrays.asList(new OnePassingKoan(), new OneFailingKoan()));
    new CommandLineArgumentRunner().run();
    assertSystemOutContains(Strings.getMessage("passing_suites")+": OnePassingKoan"+EOL+
        Strings.getMessage("remaining_suites")+": OneFailingKoan");
  }
View Full Code Here

  }
 
  @Test
  public void progressAllPassing() throws Throwable {
    stubAllKoans(Arrays.asList(new OnePassingKoan()));
    new CommandLineArgumentRunner().run();
    StringBuilder sb = new StringBuilder(Strings.getMessage("progress")).append(" ")
                  .append(PROGRESS_BAR_START);
    for(int i = 0; i < PROGRESS_BAR_WIDTH; i++){ // 100% success
      sb.append(COMPLETE_CHAR);
    }
View Full Code Here

  }
 
  @Test
  public void progressAllFailing() throws Throwable {
    stubAllKoans(Arrays.asList(new OneFailingKoan(), new OneFailingKoanDifferentName()));
    new CommandLineArgumentRunner().run();
    StringBuilder sb = new StringBuilder(
        Strings.getMessage("progress")).append(" ").append(
        PROGRESS_BAR_START);
    for(int i = 0; i < PROGRESS_BAR_WIDTH; i++){ // 100% failed
      sb.append(INCOMPLETE_CHAR);
View Full Code Here

  }
 
  @Test
  public void progressFiftyFifty() throws Throwable {
    stubAllKoans(Arrays.asList(new OnePassingKoan(), new OneFailingKoan()));
    new CommandLineArgumentRunner().run();
    StringBuilder sb = new StringBuilder(
        Strings.getMessage("progress")).append(" ").append(
        PROGRESS_BAR_START);
    for(int i = 0; i < PROGRESS_BAR_WIDTH / 2; i++){ // 50% succeeded
      sb.append(COMPLETE_CHAR);
View Full Code Here

  }
 
  @Test
  public void whatWentWrongExplanation() throws Throwable {
    stubAllKoans(Arrays.asList(new OneFailingKoan()));
    new CommandLineArgumentRunner().run();
    assertSystemOutContains(new StringBuilder(
        Strings.getMessage("what_went_wrong")).append(
        ": ").append(
        EOL).append(
        "expected:<true> but was:<false>").toString());
View Full Code Here

public class ConsolePresenterTest extends CommandLineTestCase {

  @Test
  public void hintPresentation() throws Throwable {
    stubAllKoans(Arrays.asList(new OneFailingKoanDifferentName()));
    new CommandLineArgumentRunner(new CommandLineArgumentBuilder()).run();
    assertSystemOutContains(new StringBuilder(
        INVESTIGATE_IN_THE).append(
        " ").append(
        OneFailingKoanDifferentName.class.getSimpleName()).append(
        " class's ").append(
View Full Code Here

  @Test // uncomment enableEncouragement @ the top of ConsolePresenter class
  public void encouragement() throws Throwable {
    if(KoanConstants.ENABLE_ENCOURAGEMENT){
      stubAllKoans(Arrays.asList(new Class<?>[] {
          OneFailingKoan.class }));
      new CommandLineArgumentRunner().run();
      assertSystemOutContains(new StringBuilder(
          CONQUERED).append(
          " 0 ").append(
          OUT_OF).append(
          " 1 ").append(
View Full Code Here

 
  @Test
  public void testOneHundredPercentSuccessReward() throws Throwable {
    stubAllKoans(Arrays.asList(new Class<?>[] {
        OnePassingKoan.class }));
    new CommandLineArgumentRunner().run();
    assertSystemOutContains(ALL_SUCCEEDED);
    assertSystemOutDoesntContain(CONQUERED);
    assertSystemOutDoesntContain(ENCOURAGEMENT);
  }
View Full Code Here

TOP

Related Classes of com.sandwich.koan.cmdline.CommandLineArgumentRunner

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.