From 31ec07eea79504dc6860b2eb42c28bcc3bc5f5f6 Mon Sep 17 00:00:00 2001 From: Sandro Welte Date: Fri, 9 Feb 2024 17:16:00 +0100 Subject: [PATCH] Comitted Unit Test --- test/test_convert_C_to_F.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 test/test_convert_C_to_F.c diff --git a/test/test_convert_C_to_F.c b/test/test_convert_C_to_F.c new file mode 100644 index 0000000..a657ecb --- /dev/null +++ b/test/test_convert_C_to_F.c @@ -0,0 +1,28 @@ +#include "../src/convert_C_to_F.h" +#include "unity.h" +#include "limits.h" + + +void setUp(void) { + +} + +void tearDown(void) { + // Clean up resources here if needed +} + +void test_convert_temperature(void) { + float temperature = 100.0; + char from_unit = 'c'; + char to_unit = 'f'; + + // Perform the conversion + float result = convert_temperature(temperature, from_unit, to_unit); + + // Define the expected result (100 degrees Celsius to Fahrenheit is 212) + float expectedResult = 212; + + // Assert the result + TEST_ASSERT_EQUAL_FLOAT(expectedResult, result); +} +