diff --git a/build/test/cache/test_sendmoney.c b/build/test/cache/test_sendmoney.c index f3b798b..9534927 100644 --- a/build/test/cache/test_sendmoney.c +++ b/build/test/cache/test_sendmoney.c @@ -91,3 +91,65 @@ void test_sendmoney_NeedToImplement(void) do {if (!(expected4)) {} else {UnityFail( ((" Expected FALSE Was TRUE")), (UNITY_UINT)((UNITY_UINT)(39)));}} while(0); } + + + + + +void test_getAvailableAccountBalance(void) + +{ + + + + + + + + double expected1 = 24.0; + + int length = 2; + + + + + + + + double result = getAvailableAccountBalance(length); + + + + + + UnityAssertEqualNumber((UNITY_INT)((expected1)), (UNITY_INT)((result)), ( + + ((void *)0) + + ), (UNITY_UINT)(56), UNITY_DISPLAY_STYLE_INT); + +} + + + +void test_getAmount(void) + +{ + + + + float expected = 500.1; + + + + float result = getAmount(expected); + + + + UnityAssertEqualNumber((UNITY_INT)((expected)), (UNITY_INT)((result)), ( + + ((void *)0) + + ), (UNITY_UINT)(66), UNITY_DISPLAY_STYLE_INT); + +} diff --git a/build/test/out/c/test_sendmoney.o b/build/test/out/c/test_sendmoney.o index 02c6fbd..3c4d294 100644 Binary files a/build/test/out/c/test_sendmoney.o and b/build/test/out/c/test_sendmoney.o differ diff --git a/build/test/out/c/test_sendmoney_runner.o b/build/test/out/c/test_sendmoney_runner.o index 83b78e3..2237905 100644 Binary files a/build/test/out/c/test_sendmoney_runner.o and b/build/test/out/c/test_sendmoney_runner.o differ diff --git a/build/test/out/test_sendmoney.out b/build/test/out/test_sendmoney.out index af4b838..8296b69 100644 Binary files a/build/test/out/test_sendmoney.out and b/build/test/out/test_sendmoney.out differ diff --git a/build/test/preprocess/files/test_sendmoney.c b/build/test/preprocess/files/test_sendmoney.c index f3b798b..9534927 100644 --- a/build/test/preprocess/files/test_sendmoney.c +++ b/build/test/preprocess/files/test_sendmoney.c @@ -91,3 +91,65 @@ void test_sendmoney_NeedToImplement(void) do {if (!(expected4)) {} else {UnityFail( ((" Expected FALSE Was TRUE")), (UNITY_UINT)((UNITY_UINT)(39)));}} while(0); } + + + + + +void test_getAvailableAccountBalance(void) + +{ + + + + + + + + double expected1 = 24.0; + + int length = 2; + + + + + + + + double result = getAvailableAccountBalance(length); + + + + + + UnityAssertEqualNumber((UNITY_INT)((expected1)), (UNITY_INT)((result)), ( + + ((void *)0) + + ), (UNITY_UINT)(56), UNITY_DISPLAY_STYLE_INT); + +} + + + +void test_getAmount(void) + +{ + + + + float expected = 500.1; + + + + float result = getAmount(expected); + + + + UnityAssertEqualNumber((UNITY_INT)((expected)), (UNITY_INT)((result)), ( + + ((void *)0) + + ), (UNITY_UINT)(66), UNITY_DISPLAY_STYLE_INT); + +} diff --git a/build/test/results/test_sendmoney.fail b/build/test/results/test_sendmoney.fail new file mode 100644 index 0000000..3c11981 --- /dev/null +++ b/build/test/results/test_sendmoney.fail @@ -0,0 +1,27 @@ +--- +:source: + :path: test + :file: test_sendmoney.c +:successes: +- :test: test_sendmoney_NeedToImplement + :line: 13 + :message: '' + :unity_test_time: 0 +- :test: test_getAmount + :line: 59 + :message: '' + :unity_test_time: 0 +:failures: +- :test: test_getAvailableAccountBalance + :line: 56 + :message: Expected 24 Was 0 + :unity_test_time: 0 +:ignores: [] +:counts: + :total: 3 + :passed: 2 + :failed: 1 + :ignored: 0 +:stdout: +- 'Error: customer data file cannot be opened!' +:time: 0.04625630000009551 diff --git a/build/test/results/test_sendmoney.pass b/build/test/results/test_sendmoney.pass deleted file mode 100644 index 3182902..0000000 --- a/build/test/results/test_sendmoney.pass +++ /dev/null @@ -1,18 +0,0 @@ ---- -:source: - :path: test - :file: test_sendmoney.c -:successes: -- :test: test_sendmoney_NeedToImplement - :line: 13 - :message: '' - :unity_test_time: 0 -:failures: [] -:ignores: [] -:counts: - :total: 1 - :passed: 1 - :failed: 0 - :ignored: 0 -:stdout: [] -:time: 0.06175900000016554 diff --git a/build/test/runners/test_sendmoney_runner.c b/build/test/runners/test_sendmoney_runner.c index 63fa0b9..0ab5d87 100644 --- a/build/test/runners/test_sendmoney_runner.c +++ b/build/test/runners/test_sendmoney_runner.c @@ -11,6 +11,8 @@ char* GlobalOrderError; extern void setUp(void); extern void tearDown(void); extern void test_sendmoney_NeedToImplement(void); +extern void test_getAvailableAccountBalance(void); +extern void test_getAmount(void); /*=======Mock Management=====*/ @@ -76,6 +78,8 @@ int main(void) { UnityBegin("test_sendmoney.c"); run_test(test_sendmoney_NeedToImplement, "test_sendmoney_NeedToImplement", 13); + run_test(test_getAvailableAccountBalance, "test_getAvailableAccountBalance", 43); + run_test(test_getAmount, "test_getAmount", 59); return UnityEnd(); } diff --git a/src/a.exe b/src/a.exe index 202db17..ed47b9f 100644 Binary files a/src/a.exe and b/src/a.exe differ diff --git a/test/test_sendmoney.c b/test/test_sendmoney.c index 8130bc7..66be905 100644 --- a/test/test_sendmoney.c +++ b/test/test_sendmoney.c @@ -40,17 +40,17 @@ void test_sendmoney_NeedToImplement(void) } // hier wird die Methode getAvailableAccountBalance()getestet -/*void test_getAvailableAccountBalance(void) +void test_getAvailableAccountBalance(void) { // Arrage double expected1 = 24.0; - int leng = 2; + int length = 2; // Act - double result = getAvailableAccountBalance(leng); + double result = getAvailableAccountBalance(length); // Assert TEST_ASSERT_EQUAL(expected1, result); @@ -64,6 +64,6 @@ void test_getAmount(void) float result = getAmount(expected); TEST_ASSERT_EQUAL(expected, result); -}*/ +} #endif // TEST