def test_model_sphere_message_logging(self): model = VolumeViewModel() model.set_figure_type(1) model.set_start_value(10) model.set_end_value(3) model.perform() log_message = [ 'Hi!', 'Setting radius value - 10', 'Setting height value - 3', 'Radiobutton 1 (sphere) selected', 'Result = 4188.79' ] self.assertEqual(log_message, model.logger.get_log_messages()[-5:])
def test_calculate_sphere_volume_3(self): model = VolumeViewModel(3, 5) model.set_figure_type(1) model.perform() self.assertEqual(113.097, model.get_result())
def test_calculate_cylinder_volume_3_5(self): model = VolumeViewModel(3, 5) model.set_figure_type(2) model.perform() self.assertEqual(141.372, model.get_result())
def test_calculate_cube_volume_5(self): model = VolumeViewModel(3, 5) model.set_figure_type(0) model.perform() self.assertEqual(125, model.get_result())