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.

28 lines
491 B

  1. #include "unity.h"
  2. #include "conversionOfNumbers.h"
  3. void setUp(){}
  4. void tearDown(){}
  5. void test_convert2ToBinaryStr(){
  6. //arrange
  7. char* result;
  8. char expected[] = "10";
  9. //act
  10. result = convertIntToBinaryStr(2);
  11. //assert
  12. TEST_ASSERT_EQUAL_STRING(expected, result);
  13. }
  14. void test_binaryStringLengthOfInput5is3(){
  15. //arrange
  16. int result;
  17. int expected = 3;
  18. //act
  19. result = binaryStrLen(5);
  20. //assert
  21. TEST_ASSERT_EQUAL_INT(expected, result);
  22. }