def testTwoElementsGivesOkWithExistingNumber(self): chopper = KarateChopper() actual = chopper.chop(1, [1, 3]) expected = 0 self.assertEquals(actual, expected, "Not correctly chopped. {0} != {1}".format(actual, expected)) actual = chopper.chop(3, [1, 3]) expected = 1 self.assertEquals(actual, expected, "Not correctly chopped. {0} != {1}".format(actual, expected))
def testOneElementGivesOkIfNumberIsEquals(self): chopper = KarateChopper() actual = chopper.chop(1, [1]) expected = 0 self.assertEquals(actual, expected, "Not correctly chopped. {0} != {1}".format(actual, expected))
def testNoElementsGivesError(self): chopper = KarateChopper() actual = chopper.chop(3, []) expected = -1 self.assertEquals(actual, expected, "Not correctly chopped. {0} != {1}".format(actual, expected))