Sha256: 5ee308d07357d5ab48194523ed2024e74ccb721671c0839cca056bf648008ef8

Contents?: true

Size: 1.04 KB

Versions: 66

Compression:

Stored size: 1.04 KB

Contents

#include "vendor/unity.h"
#include "../src/two_fer.h"
#include <stddef.h>

#define BUFFER_SIZE (100)

void setUp(void)
{
}

void tearDown(void)
{
}

void test_two_fer_no_name_given(void)
{
   char response[BUFFER_SIZE];
   const char *expected = "One for you, one for me.";
   two_fer(response, NULL);
   TEST_ASSERT_EQUAL_STRING(expected, response);
}

void test_two_fer_a_name_given(void)
{
   TEST_IGNORE();               // delete this line to run test
   char response[BUFFER_SIZE];
   const char *expected = "One for Alice, one for me.";
   two_fer(response, "Alice");
   TEST_ASSERT_EQUAL_STRING(expected, response);
}

void test_two_fer_another_name_given(void)
{
   TEST_IGNORE();
   char response[BUFFER_SIZE];
   const char *expected = "One for Bob, one for me.";
   two_fer(response, "Bob");
   TEST_ASSERT_EQUAL_STRING(expected, response);
}

int main(void)
{
   UnityBegin("test/test_two_fer.c");

   RUN_TEST(test_two_fer_no_name_given);
   RUN_TEST(test_two_fer_a_name_given);
   RUN_TEST(test_two_fer_another_name_given);

   UnityEnd();
   return 0;
}

Version data entries

66 entries across 66 versions & 1 rubygems

Version Path
trackler-2.2.1.180 tracks/c/exercises/two-fer/test/test_two_fer.c
trackler-2.2.1.179 tracks/c/exercises/two-fer/test/test_two_fer.c
trackler-2.2.1.178 tracks/c/exercises/two-fer/test/test_two_fer.c
trackler-2.2.1.177 tracks/c/exercises/two-fer/test/test_two_fer.c
trackler-2.2.1.176 tracks/c/exercises/two-fer/test/test_two_fer.c
trackler-2.2.1.175 tracks/c/exercises/two-fer/test/test_two_fer.c
trackler-2.2.1.174 tracks/c/exercises/two-fer/test/test_two_fer.c
trackler-2.2.1.173 tracks/c/exercises/two-fer/test/test_two_fer.c
trackler-2.2.1.172 tracks/c/exercises/two-fer/test/test_two_fer.c
trackler-2.2.1.171 tracks/c/exercises/two-fer/test/test_two_fer.c
trackler-2.2.1.170 tracks/c/exercises/two-fer/test/test_two_fer.c
trackler-2.2.1.169 tracks/c/exercises/two-fer/test/test_two_fer.c
trackler-2.2.1.167 tracks/c/exercises/two-fer/test/test_two_fer.c
trackler-2.2.1.166 tracks/c/exercises/two-fer/test/test_two_fer.c
trackler-2.2.1.165 tracks/c/exercises/two-fer/test/test_two_fer.c
trackler-2.2.1.164 tracks/c/exercises/two-fer/test/test_two_fer.c
trackler-2.2.1.163 tracks/c/exercises/two-fer/test/test_two_fer.c
trackler-2.2.1.162 tracks/c/exercises/two-fer/test/test_two_fer.c
trackler-2.2.1.161 tracks/c/exercises/two-fer/test/test_two_fer.c
trackler-2.2.1.160 tracks/c/exercises/two-fer/test/test_two_fer.c