Grian09/29/2020, 12:46 PM
a list of valid expected outputs, like can i just pass it a list and if the output of whatever im testing is part of that list itll say the test passed?
Vampire09/29/2020, 12:53 PM
yogi09/29/2020, 1:05 PM
assertEquals (expectedOutput.intersect(resultOutput), resultOutput, "Expected $resultOutput to be a subset of $expectedOutput" )
Vampire09/29/2020, 1:28 PM
would be better. There is no need to do a full intersect when you just want to know whether one list contains the other. So it should be
which can abort as soon as it found a discrepancy. Or in the case how I understood it
assertTrue(expectedOutput.containsAll(resultOutput), "my message")
assertTrue(expectedOutput.contains(resultOutput), "my message")
Grian09/29/2020, 1:36 PM
Vampire09/29/2020, 1:37 PM
Cedrick Cooke09/29/2020, 4:43 PM
with automatic error messages are likely worthwhile functions to create.