예제 #1
0
	def test_delete_all(self):
		notes = NotesApplication()
		notes.create("Day one at Andela BC")
		notes.create("Day two at Andela BC")
		notes.delete(1)
		notes.delete(1)
		self.assertEqual(len(notes.notes),0, msg="List should not be the same length since delete was successful")
예제 #2
0
	def test_search_mixed_case(self):
		notes = NotesApplication()
		notes.create("Day one at Andela BC")
		notes.create("Day two at Andela BC")
		self.assertEqual(notes.search("tWo"), "Showing results for search 'tWo'\nNote ID: 2\nDay two at Andela BC\n\nBy Author Guest", msg="Supposed to be return same result for 'two'")
예제 #3
0
	def test_search_capitalised1(self):
		notes = NotesApplication()
		notes.create("Day one at Andela BC")
		notes.create("Day two at Andela BC")
		self.assertEqual(notes.search("ONE"), "Showing results for search 'ONE'\nNote ID: 1\nDay one at Andela BC\n\nBy Author Guest", msg="")
예제 #4
0
	def test_search(self):
		notes = NotesApplication()
		notes.create("Day one at Andela BC")
		notes.create("Day two at Andela BC")
		self.assertEqual(notes.search("two"), "Showing results for search 'two'\nNote ID: 2\nDay two at Andela BC\n\nBy Author Guest", msg="")
예제 #5
0
	def test_search_empty_field(self):
		notes = NotesApplication()
		notes.create("Day one at Andela BC")
		notes.create("Day two at Andela BC")
		self.assertEqual(notes.search(), None, msg="Supposed to be an empty return")
예제 #6
0
	def test_get_boolean_as_index(self):
		notes = NotesApplication()
		self.assertEqual(notes.get(True), None, msg="List not empty")
예제 #7
0
	def test_alpha(self):
		notes = NotesApplication()
		self.assertEqual(notes.get('sd'), None, msg="Supposed to be out of alphabee")
예제 #8
0
	def test_get_negative_index2(self):
		notes = NotesApplication()
		self.assertEqual(notes.get(-100400000000), None, msg="Supposed to be out of range or negative")
예제 #9
0
    def test_get_negative_index(self):
        notes = NotesApplication()
        self.assertEqual(notes.get(-4), None, msg="Supposed to be out of range or negative")

	def test_get_negative_index1(self):
		notes = NotesApplication()
		self.assertEqual(notes.get(-1004), None, msg="Supposed to be out of range or negative")

	def test_get_negative_index2(self):
		notes = NotesApplication()
		self.assertEqual(notes.get(-100400000000), None, msg="Supposed to be out of range or negative")

	def test_alpha(self):
		notes = NotesApplication()
		self.assertEqual(notes.get('sd'), None, msg="Supposed to be out of alphabee")

	def test_get_boolean_as_index(self):
		notes = NotesApplication()
		self.assertEqual(notes.get(True), None, msg="List not empty")

	def test_search_empty_field(self):
		notes = NotesApplication()
		notes.create("Day one at Andela BC")
		notes.create("Day two at Andela BC")
		self.assertEqual(notes.search(), None, msg="Supposed to be an empty return")

	def test_search(self):
		notes = NotesApplication()
		notes.create("Day one at Andela BC")
		notes.create("Day two at Andela BC")
		self.assertEqual(notes.search("two"), "Showing results for search 'two'\nNote ID: 2\nDay two at Andela BC\n\nBy Author Guest", msg="")

	def test_search1(self):
		notes = NotesApplication()
		notes.create("Day one at Andela BC")
		notes.create("Day two at Andela BC")
		self.assertEqual(notes.search("one"), "Showing results for search 'one'\nNote ID: 1\nDay one at Andela BC\n\nBy Author Guest", msg="")

	def test_search_capitalised1(self):
		notes = NotesApplication()
		notes.create("Day one at Andela BC")
		notes.create("Day two at Andela BC")
		self.assertEqual(notes.search("ONE"), "Showing results for search 'ONE'\nNote ID: 1\nDay one at Andela BC\n\nBy Author Guest", msg="")

	def test_search_capitalsed_text(self):
		notes = NotesApplication()
		notes.create("Day one at Andela BC")
		notes.create("Day two at Andela BC")
		self.assertEqual(notes.search("TWO"), "Showing results for search 'TWO'\nNote ID: 2\nDay two at Andela BC\n\nBy Author Guest", msg="Supposed to be return same result for 'two'")

	def test_search_mixed_case(self):
		notes = NotesApplication()
		notes.create("Day one at Andela BC")
		notes.create("Day two at Andela BC")
		self.assertEqual(notes.search("tWo"), "Showing results for search 'tWo'\nNote ID: 2\nDay two at Andela BC\n\nBy Author Guest", msg="Supposed to be return same result for 'two'")

	def test_delete_empty_argument(self):
		notes = NotesApplication()
		notes.create("Day one at Andela BC")
		notes.create("Day two at Andela BC")
		notes.delete()
		self.assertListEqual(notes.notes,["Day one at Andela BC","Day two at Andela BC"], msg="List supposed to be unchange since delet didnt affect anything")

	def test_delete(self):
		notes = NotesApplication()
		notes.create("Day one at Andela BC")
		notes.create("Day two at Andela BC")
		notes.delete(1)
		self.assertNotEqual(len(notes.notes),2, msg="List should not be the same length since delete was successful")

	def test_delete_all(self):
		notes = NotesApplication()
		notes.create("Day one at Andela BC")
		notes.create("Day two at Andela BC")
		notes.delete(1)
		notes.delete(1)
		self.assertEqual(len(notes.notes),0, msg="List should not be the same length since delete was successful")

	def test_delete_empty_list(self):
		notes = NotesApplication()
		notes.delete(1)
		notes.delete(1)
		self.assertEqual(len(notes.notes),0, msg="List should not be the same length since delete was successful")

	def test_eidt(self):
		notes = NotesApplication()
		notes.create("Day one at Andela BC")
		notes.create("Day two at Andela BC")
		notes.edit(2, "it was fun")
		self.assertEqual(notes.notes[1],"Day two at Andela BC it was fun")
예제 #10
0
 def test_empty_get(self):
     notes = NotesApplication()
     self.assertEqual(notes.get(), None, msg="List not empty")
예제 #11
0
 def test_create_number_as_arg(self):
     notes = NotesApplication("kigold")
     notes.create("this is y am Hot")
     self.assertEqual(len(notes.notes),1)
예제 #12
0
 def test_create_number_as_arg(self):
     notes = NotesApplication()
     self.assertEqual(notes.create(23), None, msg="create not successful")
예제 #13
0
 def test_empty_create(self):
     notes = NotesApplication()
     self.assertEqual(notes.create(), "Please Enter the name of the note when creating", msg="create parameter not initialised")
예제 #14
0
	def test_eidt(self):
		notes = NotesApplication()
		notes.create("Day one at Andela BC")
		notes.create("Day two at Andela BC")
		notes.edit(2, "it was fun")
		self.assertEqual(notes.notes[1],"Day two at Andela BC it was fun")
예제 #15
0
	def test_delete_empty_list(self):
		notes = NotesApplication()
		notes.delete(1)
		notes.delete(1)
		self.assertEqual(len(notes.notes),0, msg="List should not be the same length since delete was successful")
예제 #16
0
	def test_delete_empty_argument(self):
		notes = NotesApplication()
		notes.create("Day one at Andela BC")
		notes.create("Day two at Andela BC")
		notes.delete()
		self.assertListEqual(notes.notes,["Day one at Andela BC","Day two at Andela BC"], msg="List supposed to be unchange since delet didnt affect anything")