C
C#11mo ago
Dropps

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?
No description
6 Replies
Angius
Angius11mo ago
Uh, empty request.Items is the only thing that comes to mind
Dropps
DroppsOP11mo ago
what you mean by that?
Angius
Angius11mo ago
If a collection you're foreaching 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 notice
Dropps
DroppsOP11mo ago
oh right thats actually a business rule i have to enforce there
Mayor McCheese
Mayor McCheese11mo ago
What requirement do you have for 100% coverage?
Dropps
DroppsOP11mo ago
it was the single line there that was missing a testing that i figured out now thanks to ZZZ.. comment got 100% coverage now
Want results from more Discord servers?
Add your server