|
|
|
@ -41,7 +41,7 @@ func TestGetDiaryEntryNotes(t *testing.T) {
|
|
|
|
|
teardown(app)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func DeleteDiaryEntryNote(t *testing.T) {
|
|
|
|
|
func TestDeleteDiaryEntryNote(t *testing.T) {
|
|
|
|
|
var app = setup()
|
|
|
|
|
|
|
|
|
|
var entry = app.NewDiaryEntry("Met with Nagee @ 1PM")
|
|
|
|
@ -53,7 +53,26 @@ func DeleteDiaryEntryNote(t *testing.T) {
|
|
|
|
|
teardown(app)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func DeleteDiaryEntryNoteNotFound(t *testing.T) {
|
|
|
|
|
func TestDeleteNotesForDiaryEntry(t *testing.T) {
|
|
|
|
|
var app = setup()
|
|
|
|
|
|
|
|
|
|
var entry = app.NewDiaryEntry("Met with Nagee @ 1PM")
|
|
|
|
|
app.NewDiaryEntryNote(entry.Id, "A note")
|
|
|
|
|
app.NewDiaryEntryNote(entry.Id, "Another note")
|
|
|
|
|
|
|
|
|
|
notes := app.GetDiaryEntryNotes(entry.Id)
|
|
|
|
|
assert_int(t, 2, int64(len(notes)))
|
|
|
|
|
|
|
|
|
|
is_deleted, _ := app.DeleteNotesForDiaryEntry(entry.Id)
|
|
|
|
|
assert_bool(t, true, is_deleted)
|
|
|
|
|
|
|
|
|
|
notes = app.GetDiaryEntryNotes(entry.Id)
|
|
|
|
|
assert_int(t, 0, int64(len(notes)))
|
|
|
|
|
|
|
|
|
|
teardown(app)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func TestDeleteDiaryEntryNoteNotFound(t *testing.T) {
|
|
|
|
|
var app = setup()
|
|
|
|
|
|
|
|
|
|
_, err := app.DeleteDiaryEntryNote(-1)
|
|
|
|
|