You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

38 lines
915 B

  1. #include "../src/inputHandler.h"
  2. #include "unity.h"
  3. void setUp(void) {
  4. // set stuff up here
  5. }
  6. void tearDown(void) {
  7. // clean stuff up here
  8. }
  9. void test_inputHandler_returntwoforinputminus(void) {
  10. int expectedResult = 2;
  11. int result;
  12. result = getOperationIdBySymbol('-');
  13. TEST_ASSERT_EQUAL_INT(expectedResult, result);
  14. }
  15. void test_inputHandler_returnoneforinputplus(void) {
  16. int expectedResult = 1;
  17. int result;
  18. result = getOperationIdBySymbol('+');
  19. TEST_ASSERT_EQUAL_INT(expectedResult, result);
  20. }
  21. void test_inputHandler_returnzeroforinvalidinput(void) {
  22. int expectedResult = 0;
  23. int result;
  24. result = isOperationIdValid(0);
  25. TEST_ASSERT_EQUAL_INT(expectedResult, result);
  26. }
  27. void test_inputHandler_returnoneifinputtoobig(void) {
  28. int expectedResult = 1;
  29. int result;
  30. result = isNumberTooBig(300);
  31. TEST_ASSERT_EQUAL_INT(expectedResult, result);
  32. }