@Test
 public void shouldNotHaveNunsuchSpreadsheet() throws Exception {
   // when
   GoogleSpreadsheet spreadsheet = helperUnderTest.getSpreadsheet("Nunsuch");
   // then
   assertThat(spreadsheet).isNull();
 }
 @Test
 public void shouldHaveMessagesSpreadsheet() throws Exception {
   // when
   GoogleSpreadsheet spreadsheet = helperUnderTest.getSpreadsheet("zGData Test Sheet");
   // then
   assertThat(spreadsheet).isNotNull();
   assert spreadsheet != null;
   assertThat(spreadsheet.getTitle()).isEqualTo("zGData Test Sheet");
 }
  @Test
  public void shouldNotHaveMessagesSpreadsheetNunsuchWorksheet() throws Exception {
    // when
    GoogleSpreadsheet spreadsheet = helperUnderTest.getSpreadsheet("zGData Test Sheet");
    assertThat(spreadsheet).isNotNull();
    assert spreadsheet != null;

    GoogleWorksheet worksheet = spreadsheet.getWorksheet("Nunsuch");

    // then
    assertThat(worksheet).isNull();
  }
Beispiel #4
0
  @BeforeClass
  public static void beforeEachTest() throws Exception {
    helperUnderTest = new GoogleHelper("org-wolm-testing");

    GoogleSpreadsheet spreadsheet = helperUnderTest.getSpreadsheet("zGData Test Sheet");
    assert spreadsheet != null;

    GoogleWorksheet worksheet = spreadsheet.getWorksheet("Persons");
    assert worksheet != null;

    rowsUnderTest = worksheet.getRows();
    assert rowsUnderTest != null;
  }
  @Test
  public void shouldHaveMessagesSpreadsheetWorksheets() throws Exception {
    // when
    GoogleSpreadsheet spreadsheet = helperUnderTest.getSpreadsheet("zGData Test Sheet");
    assertThat(spreadsheet).isNotNull();
    assert spreadsheet != null;
    GoogleWorksheet persons = spreadsheet.getWorksheet("Persons");
    GoogleWorksheet jobs = spreadsheet.getWorksheet("Jobs");
    // then
    assertThat(persons).isNotNull();
    assert persons != null;
    assertThat(persons.getTitle()).isEqualTo("Persons");

    assertThat(jobs).isNotNull();
    assert jobs != null;
    assertThat(jobs.getTitle()).isEqualTo("Jobs");
  }