Unit tests for the BatteryController class. More...
#include "BatteryController.hpp"
#include "MockI2CController.hpp"
#include <gmock/gmock.h>
#include <gtest/gtest.h>
Go to the source code of this file.
Data Structures | |
class | BatteryControllerTest |
Test fixture for testing the BatteryController class. More... | |
Functions | |
TEST_F (BatteryControllerTest, Initialization_CallsCalibration) | |
Ensures that the battery controller initializes correctly. | |
TEST_F (BatteryControllerTest, GetBatteryPercentage_CorrectCalculation) | |
Ensures that the battery percentage is calculated correctly. | |
Unit tests for the BatteryController class.
This file contains unit tests for the BatteryController class, using Google Test and Google Mock frameworks.
Definition in file test_BatteryController.cpp.
TEST_F | ( | BatteryControllerTest | , |
GetBatteryPercentage_CorrectCalculation | ) |
Ensures that the battery percentage is calculated correctly.
This test verifies that the battery percentage is calculated correctly. The test uses known values for the bus voltage and shunt voltage to calculate the expected battery percentage.
Definition at line 66 of file test_BatteryController.cpp.
TEST_F | ( | BatteryControllerTest | , |
Initialization_CallsCalibration | ) |
Ensures that the battery controller initializes correctly.
This test verifies that the battery controller initializes correctly.
Definition at line 49 of file test_BatteryController.cpp.