unitTest.cpp 997 B

1234567891011121314151617
  1. Describe(camel_to_snake)
  2. {
  3. // camelCase to snake_case tests
  4. It(test1){Assert::That(toSnakeCase("edabit"), Equals("edabit"));}
  5. It(test2){Assert::That(toSnakeCase("helloEdabit"), Equals("hello_edabit"));}
  6. It(test3){Assert::That(toSnakeCase("isModalOpen"), Equals("is_modal_open"));}
  7. It(test4){Assert::That(toSnakeCase("getBackgroundColor"), Equals("get_background_color"));}
  8. It(test5){Assert::That(toSnakeCase("isLoading"), Equals("is_loading"));}
  9. It(test6){Assert::That(toSnakeCase("x"), Equals("x"));}
  10. // snake_case to camelCase tests
  11. It(test7){Assert::That(toCamelCase("edabit"), Equals("edabit"));}
  12. It(test8){Assert::That(toCamelCase("hello_edabit"), Equals("helloEdabit"));}
  13. It(test9){Assert::That(toCamelCase("is_modal_open"), Equals("isModalOpen"));}
  14. It(test10){Assert::That(toCamelCase("get_background_color"), Equals("getBackgroundColor"));}
  15. It(test11){Assert::That(toCamelCase("is_loading"), Equals("isLoading"));}
  16. It(test12){Assert::That(toCamelCase("x"), Equals("x"));}
  17. };