Isjson test in MXUnit

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

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

Is there any MXUnit function for checking assert - is it JSON or not, for example assertIsQuery() in MXUnit?

+6
source share
1 answer

According to the MXUnit page, there is no function inline statements . It’s best to test the function like you do, or using the assertTrue() function

 assertTrue(isJSON(userEventItems), 'The return must be json'); 
+5
source

Source: https://habr.com/ru/post/971924/


All Articles