def testGetSubArrayFrom1To3(self): test_input = ["The", "Quick", "Brown", "Fox", "Jumps"] expected = ["Quick", "Brown"] start_index = 1 end_index = 3 actual = StringArrayUtils.get_sub_array(test_input, start_index, end_index) self.assertEqual(expected, actual)
def testGetSubArrayOutOfBounds2(self): test_input = ["The", "Quick", "Brown", "Fox", "Jumps"] start_index = -1 end_index = -10 with self.assertRaises(IndexError): StringArrayUtils.get_sub_array(test_input, start_index, end_index)
def testGetEndingArrayOutOfBounds1(self): test_input = ["The", "Quick", "Brown", "Fox", "Jumps"] start_index = 98 with self.assertRaises(IndexError): StringArrayUtils.get_ending_array(test_input, start_index)
def testGetEndingArrayFrom1(self): test_input = ["The", "Quick", "Brown", "Fox", "Jumps"] expected = ["Quick", "Brown", "Fox", "Jumps"] start_index = 1 actual = StringArrayUtils.get_ending_array(test_input, start_index) self.assertEqual(expected, actual)