Skip to content

Commit

Permalink
commented reason for test case
Browse files Browse the repository at this point in the history
Signed-off-by: Coury Richards <[email protected]>
  • Loading branch information
couryrr-afs committed Jul 8, 2024
1 parent 50ad01e commit 18f3f28
Showing 1 changed file with 29 additions and 7 deletions.
36 changes: 29 additions & 7 deletions tests/lib/ocpp/v201/test_charge_point.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,35 @@ class ChargePointFixture : public testing::Test {
ocpp::v201::Callbacks callbacks;
};

/*
* K01.FR.02 states
*
* "The CSMS MAY send a new charging profile for the EVSE that SHALL be used
* as a limit schedule for the EV."
*
* When using libocpp, a charging station is notified of a new charging profile
* by means of the set_charging_profiles_callback. In order to ensure that a new
* profile can be immediately "used as a limit schedule for the EV", a
* valid set_charging_profiles_callback must be provided.
*
* As part of testing that K01.FR.02 is met, we provide the following tests that
* confirm an OCPP 2.0.1 ChargePoint with smart charging enabled will only
* consider its collection of callbacks valid if set_charging_profiles_callback
* is provided.
*/

TEST_F(ChargePointFixture, K01FR02_CallbacksValidityChecksIfSetChargingProfilesCallbackExists) {
configure_callbacks_with_mocks();
callbacks.set_charging_profiles_callback = nullptr;

EXPECT_FALSE(callbacks.all_callbacks_valid());
}

/*
* For completeness, we also test that all other callbacks are checked by
* all_callbacks_valid.
*/

TEST_F(ChargePointFixture, K01FR02_CallbacksAreInvalidWhenNotProvided) {
EXPECT_FALSE(callbacks.all_callbacks_valid());
}
Expand Down Expand Up @@ -138,13 +167,6 @@ TEST_F(ChargePointFixture, K01FR02_CallbacksValidityChecksIfSecurityEventCallbac
EXPECT_FALSE(callbacks.all_callbacks_valid());
}

TEST_F(ChargePointFixture, K01FR02_CallbacksValidityChecksIfSetChargingProfilesCallbackExists) {
configure_callbacks_with_mocks();
callbacks.set_charging_profiles_callback = nullptr;

EXPECT_FALSE(callbacks.all_callbacks_valid());
}

TEST_F(ChargePointFixture, K01FR02_CallbacksValidityChecksIfOptionalVariableChangedCallbackIsNotSetOrNotNull) {
configure_callbacks_with_mocks();

Expand Down

0 comments on commit 18f3f28

Please sign in to comment.