Esempio n. 1
0
 def test_calc_bar_bmi_no(self):
     test_name = "Calc Chart Data Test #17"
     data_to_test = 'Normal'
     class_to_test = CalcData()
     expected_result = 1
     # Action
     class_to_test.calc_bar_bmi(data_to_test)
     result = class_to_test.count_bmi_no
     # Assert
     try:
         self.assertTrue(result == expected_result)
     except AssertionError:
         print("{} Failed - Should be {}, but was {}.".format(
             test_name, expected_result, result))
     else:
         print("{} Passed".format(test_name))
Esempio n. 2
0
 def test_bar_chart_false(self):
     test_name = "Calc Chart Data Bar Chart FALSE Test #05"
     data_to_test = "testing"
     class_to_test = CalcData()
     expected_result = None
     class_to_test.calc_bar_bmi("Overweight")
     class_to_test.calc_bar_bmi("Underweight")
     # Action
     result = class_to_test.bar_chart(data_to_test)
     # Assert
     try:
         self.assertTrue(result == expected_result)
     except AssertionError:
         print("{} Failed - Should be {}, but was {}.".format(
             test_name, expected_result, result))
     else:
         print("{} Passed".format(test_name))