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.
39 lines
915 B
39 lines
915 B
#include "../src/inputHandler.h"
|
|
#include "unity.h"
|
|
|
|
void setUp(void) {
|
|
// set stuff up here
|
|
}
|
|
|
|
void tearDown(void) {
|
|
// clean stuff up here
|
|
}
|
|
|
|
|
|
void test_inputHandler_returntwoforinputminus(void) {
|
|
int expectedResult = 2;
|
|
int result;
|
|
result = getOperationIdBySymbol('-');
|
|
TEST_ASSERT_EQUAL_INT(expectedResult, result);
|
|
}
|
|
|
|
void test_inputHandler_returnoneforinputplus(void) {
|
|
int expectedResult = 1;
|
|
int result;
|
|
result = getOperationIdBySymbol('+');
|
|
TEST_ASSERT_EQUAL_INT(expectedResult, result);
|
|
}
|
|
|
|
void test_inputHandler_returnzeroforinvalidinput(void) {
|
|
int expectedResult = 0;
|
|
int result;
|
|
result = isOperationIdValid(0);
|
|
TEST_ASSERT_EQUAL_INT(expectedResult, result);
|
|
}
|
|
|
|
void test_inputHandler_returnoneifinputtoobig(void) {
|
|
int expectedResult = 1;
|
|
int result;
|
|
result = isNumberTooBig(300);
|
|
TEST_ASSERT_EQUAL_INT(expectedResult, result);
|
|
}
|