Browse Source

refactoring: change variable names in test_calculatorCube.c

remotes/origin/feature/calculator-cube
fdai7514 2 years ago
parent
commit
eb6b8e0450
  1. 25
      tests/test_calculatorCube.c

25
tests/test_calculatorCube.c

@ -3,6 +3,10 @@
#include "unity.h"
#include "calculatorCube.c"
// Note:
/* This Function may or may not be implemented in actual program, even if it is merged to the main branch.
If it is temporarily not included in the main Program, then this has a role in future Development of the Project */
void setUp(void)
{
@ -14,22 +18,23 @@ void tearDown(void)
void test1_calculatorCube(void)
{
float p, a, e;
p = 5;
a = calculatorCube(p);
e = p * p * p;
TEST_ASSERT_EQUAL_FLOAT(e, a);
float num, actual, expected; //Arrange
num = 5;
expected = num * num * num;
actual = calculatorCube(num); //Act
TEST_ASSERT_EQUAL_FLOAT(expected, actual); //Assert
}
void test2_calculatorCube(void)
{
float p, a, e;
p = 6;
a = calculatorCube(p);
e = p * p * p;
TEST_ASSERT_EQUAL_FLOAT(e, a);
float num, actual, expected; //Arrange
num = 6;
expected = num * num * num;
actual = calculatorCube(num); //Act
TEST_ASSERT_EQUAL_FLOAT(expected, actual); //Assert
}
#endif // TEST
Loading…
Cancel
Save