From 60036f51ba00ce29aa305ccd9347389e5e458f00 Mon Sep 17 00:00:00 2001 From: Thomas Papendieck Date: Mon, 12 Dec 2022 21:35:05 +0100 Subject: [PATCH] =?UTF-8?q?Muster=20L=C3=B6sung?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/test/c/test_berechnung.c | 42 ++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/src/test/c/test_berechnung.c b/src/test/c/test_berechnung.c index 81db07d..b84757a 100644 --- a/src/test/c/test_berechnung.c +++ b/src/test/c/test_berechnung.c @@ -22,6 +22,48 @@ void test_berechnung_2_convertsToDigit(void) result = convert(2); /* assert */ + TEST_ASSERT_EQUAL_STRING (expected, result); +} + +void test_berechnung_11_convertsToDigits(void) +{ + char* result; + char expected[] = "11\n"; + + result = convert(11); + + TEST_ASSERT_EQUAL_STRING (expected, result); +} + +void test_berechnung_10_convertsTo_buzz(void) +{ + char* result; + char expected[] = "buzz\n"; + + result = convert(10); + + TEST_ASSERT_EQUAL_STRING (expected, result); +} + +void test_berechnung_20_30_is_10(void) +{ + int result; + int expected = 10; + + result = gcd(20, 30); + + TEST_ASSERT_EQUAL_INT (expected, result); +} + + +void test_berechnung_20_30_is_11_fails(void) +{ + int result; + int expected = 11; + + result = gcd(20, 30); + + TEST_ASSERT_EQUAL_INT (expected, result); } #endif // TEST