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.
41 lines
689 B
41 lines
689 B
#include "unity.h"
|
|
#include "conversionOfNumbers.h"
|
|
|
|
void setUp(){}
|
|
void tearDown(){}
|
|
|
|
void test_convert2ToBinaryStr(){
|
|
//arrange
|
|
char* result;
|
|
char expected[] = "10";
|
|
|
|
//act
|
|
result = convertIntToBinaryStr(2);
|
|
|
|
//assert
|
|
TEST_ASSERT_EQUAL_STRING(expected, result);
|
|
}
|
|
|
|
void test_binaryStringLengthOfInput5is3(){
|
|
//arrange
|
|
int result;
|
|
int expected = 3;
|
|
|
|
//act
|
|
result = binaryStrLen(5);
|
|
|
|
//assert
|
|
TEST_ASSERT_EQUAL_INT(expected, result);
|
|
}
|
|
|
|
void test_binaryStringLengthOfInput0is1(){
|
|
//arrange
|
|
int result;
|
|
int expected = 1;
|
|
|
|
//act
|
|
result = binaryStrLen(0);
|
|
|
|
//assert
|
|
TEST_ASSERT_EQUAL_INT(expected, result);
|
|
}
|