Esempio n. 1
0
 def testChangeMaker5(self):
     """
     GIVEN: parameters of 20.20 owed, 20.20 paid
     WHEN: changeMaker(20.20, 20.20) is called
     THEN: 'Change: $0.00' is returned
     """
     x = moreSelection.changeMaker(20.20, 20.20)
     self.assertEqual(x, 'Change: $0.00')
Esempio n. 2
0
 def testChangeMaker6(self):
     """
     GIVEN: parameters of 36.80 owed, 50 paid
     WHEN: changeMaker(36.80, 50) is called
     THEN: 'Change: $13.20\n1 ten\n3 ones\n2 dimes'
           is returned with '\n' in the string indicating a new line
     """
     x = moreSelection.changeMaker(36.80, 50)
     self.assertEqual(x, 'Change: $13.20\n1 ten\n3 ones\n2 dimes')
Esempio n. 3
0
 def testChangeMaker3(self):
     """
     GIVEN: parameters of 10.01 owed, 68.95 paid
     WHEN: changeMaker(10.01, 68.95) is called
     THEN: 'Change: $58.94\n2 twenties\n1 ten\n1 five\n3 ones\n3 quarters\n1 dime\n1 nickel\n4 pennies'
           is returned with '\n' in the string indicating a new line
     """
     x = moreSelection.changeMaker(10.01, 68.95)
     expected = 'Change: $58.94\n2 twenties\n1 ten\n1 five\n3 ones\n3 quarters\n1 dime\n1 nickel\n4 pennies'
     self.assertEqual(x, expected)
Esempio n. 4
0
 def testChangeMaker2(self):
     """
     GIVEN: parameters of 40.66 owed, 77.07 paid
     WHEN: changeMaker(40.66, 77.07) is called
     THEN: 'Change: $36.41\n1 twenty\n1 ten\n1 five\n1 one\n1 quarter\n1 dime\n1 nickel\n1 penny'
           is returned with '\n' in the string indicating a new line
     """
     x = moreSelection.changeMaker(40.66, 77.07)
     self.assertEqual(
         x,
         'Change: $36.41\n1 twenty\n1 ten\n1 five\n1 one\n1 quarter\n1 dime\n1 nickel\n1 penny'
     )
Esempio n. 5
0
 def testChangeMaker1(self):
     """
     GIVEN: parameters of 13.57 owed, 100 paid
     WHEN: changeMaker(13.57, 100) is called
     THEN: 'Change: $86.43\n4 twenties\n1 five\n1 one\n1 quarter\n1 dime\n1 nickel\n3 pennies'
           is returned with '\n' in the string indicating a new line
     """
     x = moreSelection.changeMaker(13.57, 100)
     self.assertEqual(
         x,
         'Change: $86.43\n4 twenties\n1 five\n1 one\n1 quarter\n1 dime\n1 nickel\n3 pennies'
     )