Unit tests for the MileageManager class. More...
#include <QSignalSpy>
#include "MileageManager.hpp"
#include "MockMileageCalculator.hpp"
#include "MockMileageFileHandler.hpp"
#include <gmock/gmock.h>
#include <gtest/gtest.h>
Go to the source code of this file.
Data Structures | |
class | MileageManagerTest |
Class to test the integration between the MileageManager and the MileageCalculator and MileageFileHandler. More... | |
Functions | |
TEST_F (MileageManagerTest, Initialize_LoadsMileageFromFile) | |
Ensures that the mileage manager initializes correctly. | |
TEST_F (MileageManagerTest, OnSpeedUpdated_CallsCalculator) | |
Ensures that the mileage manager calls the calculator when the speed is updated. | |
TEST_F (MileageManagerTest, UpdateMileage_EmitsMileageUpdatedSignal) | |
Ensures that the mileage manager updates the mileage correctly. | |
TEST_F (MileageManagerTest, SaveMileage_CallsFileHandler) | |
Ensures that the mileage manager saves the mileage correctly. | |
Unit tests for the MileageManager class.
This file contains unit tests for the MileageManager class, using Google Test and Google Mock frameworks.
Definition in file test_MileageManager.cpp.
TEST_F | ( | MileageManagerTest | , |
Initialize_LoadsMileageFromFile | ) |
Ensures that the mileage manager initializes correctly.
This test verifies that the mileage manager initializes correctly.
Definition at line 57 of file test_MileageManager.cpp.
TEST_F | ( | MileageManagerTest | , |
OnSpeedUpdated_CallsCalculator | ) |
Ensures that the mileage manager calls the calculator when the speed is updated.
This test verifies that the mileage manager calls the calculator when the speed is updated.
Definition at line 75 of file test_MileageManager.cpp.
TEST_F | ( | MileageManagerTest | , |
SaveMileage_CallsFileHandler | ) |
Ensures that the mileage manager saves the mileage correctly.
This test verifies that the mileage manager saves the mileage correctly.
Definition at line 109 of file test_MileageManager.cpp.
TEST_F | ( | MileageManagerTest | , |
UpdateMileage_EmitsMileageUpdatedSignal | ) |
Ensures that the mileage manager updates the mileage correctly.
This test verifies that the mileage manager updates the mileage correctly.
Definition at line 88 of file test_MileageManager.cpp.