6

I am working on the MxUnit test frame work for CFML. In it, I want to check whether the return value of a function is a valid JSON or not. Currently I am using:

assertEquals(True,IsJSON(userEventItems),'The return must be json');

Is there any MXUnit function to check the assert is a JSON or not, like assertIsQuery() in MXUnit?

Erwin Bolwidt
  • 30,799
  • 15
  • 56
  • 79

1 Answers1

5

According to the MXUnit built-in assertions page there is not a function. Your best bet is to test the function the way you are or by using the assertTrue() function

assertTrue(isJSON(userEventItems), 'The return must be json');
Matt Busche
  • 14,216
  • 5
  • 36
  • 61