how to test untestable code
hello there
before reaching 100% coverage theres a single seemingly untestable line of code
can someone tell me how am i supposed to ever reach that?
6 Replies
Uh, empty
request.Items
is the only thing that comes to mindwhat you mean by that?
If a collection you're
foreach
ing over is empty, the whole loop just gets skipped
So that's the only thing that comes to my mind when it comes to potentially reaching the closing brace of the loop in a way that coverage will noticeoh right thats actually a business rule i have to enforce there
What requirement do you have for 100% coverage?
it was the single line there that was missing a testing that i figured out now thanks to ZZZ.. comment
got 100% coverage now