diff --git a/tests/test_currencyExchange.c b/tests/test_currencyExchange.c index 942436f..b27cd94 100644 --- a/tests/test_currencyExchange.c +++ b/tests/test_currencyExchange.c @@ -39,5 +39,34 @@ void test_toUSD(void) { } +void test_toGBP(void) { + + /* Arrange */ + + int length = 5; + float euro[] = {34, 233, 400, 100, 45}; + + float expectedGBP[length]; + float resultGBP[length]; + + for (int i = 0; i < length; i++) { + resultGBP[i] = toGBP(euro[i]); + } + + /* Act */ + + for (int i = 0; i < length; i++) { + expectedGBP[i] = euro[i] * CURRENT_GBP_RATE_OF_ONE_EURO; + } + + /* Assert */ + + for (int i = 0; i < length; i++) { + TEST_ASSERT_EQUAL_FLOAT(expectedGBP[i], resultGBP[i]); + } + +} + + #endif // TEST