unitTest.cpp 416 B

12345678
  1. Describe(get_last_array_item)
  2. {
  3. It(test1){Assert::That(getLastItem((int[]){1, 2, 3}, 3), Equals(3));}
  4. It(test2){Assert::That(getLastItem((int[]){1, 2, 3, 56, 87, 23, 65, 45}, 8), Equals(45));}
  5. It(test3){Assert::That(getLastItem((int[]){1}, 1), Equals(1));}
  6. It(test4){Assert::That(getLastItem((int[]){0}, 1), Equals(0));}
  7. It(test5){Assert::That(getLastItem((int[]){-1, 3, 4, -45, -10}, 5), Equals(-10));}
  8. };