Beispiel #1
0
    def test_model_perform_all_message_logging(self):
        model = VolumeViewModel()
        model.set_start_value(3)
        model.set_end_value(10)
        model.perform()

        log_message = [
            'Hi!', 'Setting radius value - 3', 'Setting height value - 10',
            'Radiobutton 0 (cube) selected', 'Result = 1000'
        ]
        self.assertEqual(log_message, model.logger.get_log_messages()[-5:])
Beispiel #2
0
    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:])
Beispiel #3
0
 def test_model_perform_logging(self):
     model = VolumeViewModel()
     model.set_start_value(3)
     model.set_end_value(10)
     model.perform()
     self.assertEqual('Result = 1000', model.logger.get_last_message())
Beispiel #4
0
 def test_set_start_value_logging(self):
     model = VolumeViewModel()
     model.set_start_value(4)
     self.assertEqual('Setting radius value - 4',
                      model.logger.get_last_message())
Beispiel #5
0
 def test_correct_set_value(self):
     model = VolumeViewModel()
     model.set_start_value(3)
     model.set_end_value(5)
     self.assertEqual(3, model.get_start_value())
     self.assertEqual(5, model.get_end_value())
Beispiel #6
0
 def test_button_disabled_none_5(self):
     model = VolumeViewModel(3, 5)
     model.set_start_value(None)
     self.assertEqual('disabled', model.is_button_enable())