Earlier this is working with 3 but due to few modifications to this class, Now it is not working. What would be the problem if i change like
System.assertEquals(lAccrSaleConShare.size(), 2);
Earlier this is working with 3 but due to few modifications to this class, Now it is not working. What would be the problem if i change like
System.assertEquals(lAccrSaleConShare.size(), 2);
Best Answer
Don't follow the example set by this code.
system.assertEquals(expected_value, actual_value, message)
.expected_value
andactual_value
are flipped.message
argument is optional, it is highly recommended and might have helped you here.static final Integer RECORD_COUNT = Limits.getLimitQueries() + 1
, which you could use in place of3
.setManualShareAfterInsert
method. You're testing a trigger somewhere, which you haven't shared with us.setManualShareAfterUpdate
method.I can't tell you how to get your unit test working. I can't even tell if your code should work as advertised. But you might have some luck by working on Separation Of Concerns. You could break out a few discrete tasks and verify they work as expected, then build on that. The key to unit testing is to test small units of code.
I have found trying to build on top of code that tries to do dozens of things in one method is just not tenable. Here's a start for how I would refactor:
Anyway, that's probably not the answer you were looking for, but hopefully it will help you to some extent.