Пример #1
0
  @Test
  public void startingNewTestShouldStartTimeMeasurementAndNotifyListener() throws Exception {
    List<WikiPage> testPagesToRun = mock(List.class);
    TestPage page = new TestPage(mock(WikiPage.class));
    FitNesseContext fitNesseContext = mock(FitNesseContext.class);
    ResultsListener resultsListener = mock(ResultsListener.class);

    MultipleTestsRunner runner =
        new MultipleTestsRunner(
            testPagesToRun, fitNesseContext, page.getSourcePage(), resultsListener);

    runner.startingNewTest(page);
    verify(resultsListener).newTestStarted(same(page), same(runner.currentTestTime));
    assertThat(runner.currentTestTime, isAStartedTimeMeasurement());
  }
Пример #2
0
  @Test
  public void testCompleteShouldRemoveHeadOfQueueAndNotifyListener() throws Exception {
    List<WikiPage> testPagesToRun = mock(List.class);
    TestPage page = new TestPage(mock(WikiPage.class));
    FitNesseContext fitNesseContext = mock(FitNesseContext.class);
    ResultsListener resultsListener = mock(ResultsListener.class);

    MultipleTestsRunner runner =
        new MultipleTestsRunner(
            testPagesToRun, fitNesseContext, page.getSourcePage(), resultsListener);
    runner.addToProcessingQueue(page);

    TestSummary testSummary = mock(TestSummary.class);

    runner.startingNewTest(page);
    runner.testComplete(testSummary);
    verify(resultsListener)
        .testComplete(same(page), same(testSummary), same(runner.currentTestTime));
    assertThat(runner.currentTestTime, isAStoppedTimeMeasurement());
  }