Browse Source

test Methode sendmoneyNeedToImplemt

remotes/origin/feature/send-money
fdai6618 2 years ago
parent
commit
5f4fb16a7b
  1. 62
      build/test/cache/test_sendmoney.c
  2. BIN
      build/test/out/c/test_sendmoney.o
  3. BIN
      build/test/out/c/test_sendmoney_runner.o
  4. BIN
      build/test/out/test_sendmoney.out
  5. 62
      build/test/preprocess/files/test_sendmoney.c
  6. 27
      build/test/results/test_sendmoney.fail
  7. 18
      build/test/results/test_sendmoney.pass
  8. 4
      build/test/runners/test_sendmoney_runner.c
  9. BIN
      src/a.exe
  10. 8
      test/test_sendmoney.c

62
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);
}

BIN
build/test/out/c/test_sendmoney.o

BIN
build/test/out/c/test_sendmoney_runner.o

BIN
build/test/out/test_sendmoney.out

62
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);
}

27
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

18
build/test/results/test_sendmoney.pass

@ -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

4
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();
}

BIN
src/a.exe

8
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
Loading…
Cancel
Save