#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)); } void test_gethd_WithMinAndMax(void) { short min = 10; short max = 100; char *input[] = {"sdf", "1", "101", "50"}; fakeInput = input; TEST_ASSERT_EQUAL_INT64(50, gethd("", &min, &max)); }