diff --git a/test/test_userinput.c b/test/test_userinput.c new file mode 100644 index 0000000..f41c11d --- /dev/null +++ b/test/test_userinput.c @@ -0,0 +1,16 @@ +#include "unity.h" +#include "userinput.h" +#include "fakeinput.h" +#include + +void setUp(void){} +void tearDown(void){} + +void test_gets_WithMinLengthAndMaxLength(void) { + unsigned long minLength = 3; + unsigned long maxLength = 10; + char *input[] = {"ei", "e", "sddfdfdfdfdf", "dddd", NULL}; + fakeInput = input; + char *actual = gets("", &minLength, &maxLength); + TEST_ASSERT_EQUAL_CHAR_ARRAY("dddd", actual, strlen(actual)); +} \ No newline at end of file