def test_get_with_valid_index(self): """test normal get behaviour """ note_app = NotesApplication("Ben") note_app.create("Note 0") self.assertEqual(note_app.get(0), "Note 0", msg="Incorrect get method")
def test_get_with_non_int_index(self): """test get with bad parameters """ note_app = NotesApplication("Ben") note_app.create("Note 0") self.assertEqual(note_app.get(""), None, msg="string index should return None")
def test_get_with_invalid_index(self): """test get with bad parameters """ note_app = NotesApplication("Ben") note_app.create("Note 0") self.assertEqual(note_app.get(10), None, msg="Invalid index should return None")
def test_get_note_from_end(self): test = NotesApplication("test") test.create("emeka is boy") test.create(1) test.create(2) test.create("chidi is fresh") res = test.get(3) self.assertEqual("chidi is fresh",res , msg="get() method does not return the right value at the last index")
def test_get_note_from_begining(self): test = NotesApplication("test") test.create("emeka is a boy") res = test.get(0) self.assertEqual("emeka is a boy", res, msg="get() method does not return the right value at 0 index")