Test Isjson in MXUnit

114 Views Asked by At

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?

1

There are 1 best solutions below

0
On

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');