diff --git a/src/temperatur.c b/src/temperatur.c index 7a18e9e..3568a8f 100644 --- a/src/temperatur.c +++ b/src/temperatur.c @@ -1,4 +1,5 @@ #include +#include "temperatur.h" float CzuF(float tempC){ return (tempC * 9/5) + 32; @@ -20,4 +21,4 @@ int run_TemperaturRechner(){ return 0; -} \ No newline at end of file +} diff --git a/src/temperatur.h b/src/temperatur.h new file mode 100644 index 0000000..30e1a0f --- /dev/null +++ b/src/temperatur.h @@ -0,0 +1,6 @@ +#ifndef TEMPERATUR_H +#define TEMPERATUR_H + +float CzuF(float tempC); + +#endif //TEMPERATUR_H diff --git a/test/test_temperatur.c b/test/test_temperatur.c new file mode 100644 index 0000000..e46691b --- /dev/null +++ b/test/test_temperatur.c @@ -0,0 +1,22 @@ +#ifdef TEST + +#include "unity.h" + +#include "temperatur.h" + +void setUp(void) +{ +} + +void tearDown(void) +{ +} + +void test_temperaturRechner_CzuF(void) +{ +float result = CzuF(25); +float expected = 77; +TEST_ASSERT_EQUAL(expected, result); +} + +#endif