Skip to main content

Timeline for Unit Test code coverage problem

Current License: CC BY-SA 3.0

9 events
when toggle format what by license comment
Dec 7, 2014 at 5:26 comment added Eric @Krish to ensure the correct outcome. Just because you cover 100% does not mean it produces the correct outcome. You need to test the outcome which is the purpose of the asserts
Dec 7, 2014 at 4:44 comment added Krish25 @Eric,Thanks a lot dude.one Small doubt without writing Assert statements also its covering 100%,then what is the need of Assert Statements.
Dec 7, 2014 at 4:11 comment added Eric @Krish25 - it is rl.accname not r1.accname (letter l not number 1)
Dec 7, 2014 at 2:45 comment added Krish25 Compile Error: Variable does not exist: r1.accname ,i am getting this error.
Dec 6, 2014 at 14:07 comment added Keith C @Krish25 By having rl. in front of accname the test code is setting a field in an instance of relatedList. And you are right that isn't enough change to get your test to work: the Account and Contact need to be inserted into the database as well as created in memory. See the updated code in the answer.
Dec 6, 2014 at 14:06 history edited Keith C CC BY-SA 3.0
added 559 characters in body
Dec 6, 2014 at 11:55 comment added AslamK @Krish25 In your test method set rl.accname = 'xxx';.
Dec 6, 2014 at 11:38 comment added Krish25 Thank you for replay but accname is not a variable in test class,one more thing problem @Contact list
Dec 6, 2014 at 11:26 history answered Keith C CC BY-SA 3.0