summaryrefslogtreecommitdiff
path: root/src/02/05/stack_test.c
blob: c2ec4c2848a43fe903b03961ac7aaf84f115f1aa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include "stack.h"
#include <cgreen/cgreen.h>
#include <string.h>

Describe(Stack);
BeforeEach(Stack) {}
AfterEach(Stack) {}

Ensure(Stack, when_pushing_an_item_on_to_a_stack) {
  Stack *stack = stack_init(10);

  assert_that(stack_size(stack), is_equal_to(1));
  assert_that(stack_peek(stack), is_equal_to(10));
}

TestSuite *stack_tests() {
  TestSuite *suite = create_test_suite();
  add_test_with_context(suite, Stack, when_pushing_an_item_on_to_a_stack);
  return suite;
}