diff --git a/tests/test_currencyExchange.c b/tests/test_currencyExchange.c index 168f0c2..942436f 100644 --- a/tests/test_currencyExchange.c +++ b/tests/test_currencyExchange.c @@ -12,8 +12,12 @@ void tearDown(void) } void test_toUSD(void) { - int length = 5; + + /* Arrange */ + + int length = 5; float euro[] = {34, 233, 400, 100, 45}; + float expectedUSD[length]; float resultUSD[length]; @@ -21,10 +25,14 @@ void test_toUSD(void) { resultUSD[i] = toUSD(euro[i]); } + /* Act */ + for (int i = 0; i < length; i++) { expectedUSD[i] = euro[i] * CURRENT_USD_RATE_OF_ONE_EURO; } + /* Assert */ + for (int i = 0; i < length; i++) { TEST_ASSERT_EQUAL_FLOAT(expectedUSD[i], resultUSD[i]); }