コード例 #1
0
ファイル: MixedTest.java プロジェクト: ufh/TddAtddExamples
  private void createTestBooks(int count) throws Exception {

    Long startIsbn = new Long(300);
    for (int i = 0; i < count; i++) {
      BuchDO newBook = new BuchDO();
      newBook.setIsbn(startIsbn + i);
      newBook.setTitel("Fun with Testing Part " + i);
      newBook.setPreis(25.95);
      BuecherTO response = buecherService.createBuch(newBook);
      assertEquals((Object) 0, response.getReturncode());
    }
  }
コード例 #2
0
ファイル: MixedTest.java プロジェクト: ufh/TddAtddExamples
  private void createStory(BuchDO buch) throws UnsupportedDriverException, InterruptedException {

    Story story = new Story();
    story.backlog = product;
    story.title = "Title: " + buch.getTitel();
    story.estimation = "10";
    story.description = "Isbn: " + buch.getIsbn() + "/ Preis: " + buch.getPreis();

    logger.info("Creating Story: " + story.title);

    NewStoryPage newStoryPage = startPage.navigateToNewStory();
    newStoryPage.compileFormular(story);
    newStoryPage.submit();
  }
コード例 #3
0
ファイル: MixedTest.java プロジェクト: ufh/TddAtddExamples
  @Test
  public void createStoryForEachBooks() throws UnsupportedDriverException, InterruptedException {

    List<BuchDO> buecherList = readBooks();
    assertTrue(numOfBooks == buecherList.size());

    createProductForMissingBooks();

    for (BuchDO buch : buecherList) {
      createStory(buch);
    }

    // and check existence in the product
    logger.info("Checking product: " + product.title);
    ProductPage productPage = startPage.navigateToProduct(product.title, 0);
    for (BuchDO buch : buecherList) {
      productPage.storyIsShown(buch.getTitel());
    }
  }