コード例 #1
0
  @Test
  public void afterDeletingNotesShouldHaveNewNumbers() {
    sessionManager.startMobileSession(false);
    Note note1 = sessionManager.makeANote(null, "Note1", null);
    Note note2 = sessionManager.makeANote(null, "Note2", null);

    sessionManager.deleteNote(note1);
    Note note3 = sessionManager.makeANote(null, "Note3", null);

    assertThat(note3.getNumber(), not(equalTo(note2.getNumber())));
  }
コード例 #2
0
  @Test
  public void shouldJustDeleteNotesIfSessionInProgress() {
    sessionManager.startMobileSession(false);
    Note note = sessionManager.makeANote(null, null, null);

    sessionManager.deleteNote(note);

    assertThat(sessionManager.getNotes(), not(hasItem(note)));
  }