You need to sign in to do that
Don't have an account?
David Joshua
How to use System.assertEquals(ANY expected, ANY actual, ANY msg) when I have many results expected ?
Hi,
I would like to use System.assertEquals(ANY expected, ANY actual, ANY msg) with something like that :
I would like to use System.assertEquals(ANY expected, ANY actual, ANY msg) with something like that :
@IsTest static void testRecoverValue() { Integer val1 = 1353; Integer val2 = 1300; Integer val3 = 0; String json = FranceOperation_Utility_ReloadImpressions.getjsonFranceOperationTargetingDistibution(); Integer val = FranceOperations_TargetDistri.parse(json); System.assertEquals(val1||val2||val3, val, 'test for function recoverValue() suceeded'); }I know the syntax on my last line is not correct but I would like to know the proper way to write it. Is there a way to include many integers in my value expected. How do I do that ? Should it be more like this :
System.assertEquals(val1, val, 'test for function recoverValue() suceeded') || System.assertEquals(val2, val, 'test for function recoverValue() suceeded') || System.assertEquals(val3, val, 'test for function recoverValue() suceeded');(I'm a begginer, and moreover, who has not written many tests before. Thank you for your patience !)
Or you have to go though the one by by one as shown below
All Answers
Or you have to go though the one by by one as shown below