C
C#7mo 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
Angius7mo ago
Uh, empty request.Items is the only thing that comes to mind
Dropps
Dropps7mo ago
what you mean by that?
Angius
Angius7mo 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
Dropps7mo ago
oh right thats actually a business rule i have to enforce there
Mayor McCheese
Mayor McCheese7mo ago
What requirement do you have for 100% coverage?
Dropps
Dropps7mo 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
More Posts
EF Core TPC Inheritance strategy - Select query to include individual navigational propertyHello, I have 2 similar entities, which are derived from a base class. The base class is `Animal`, Anyway to make code that knows a call has gone to voicemailI'm using 3cx dialer and there is no way to do that, If you know any way on doing this please help mWhy does my very simple C# program leak 890MB of RAM?I'm writing a very simple C# application that downloads dummy data from URLs to test internet speed,Hello! i am new to c # what editor should i use?i normally use visual studio code but i get reccomended to use jetbrains rider for c sharp which do Automate creation of XSD during buildHi, I have a data model in an assembly used to read program configuration. I would like to generate Package Winforms app into an installerI have a winform project that has multiple forms, that winforms project also depends on other class Get index of a selected item in a list viewSo, how to get an index of a clicked element in a scroll viewer? Or a clicked element in a scroll viGUI Design / Thoughts on user experienceGood day/evening. I wanted to ask in terms of design. I have three buttons (image includes a view of[ERCore7.0] Customize ModelValidator {Microsoft.EntityFrameworkCore.Infrastructure}i making CutsmonModelValidator to rewirte ValidateNoMutableKeys() method to design another logic. npackages cant find pathbeen having the same error since yesterday idk atp tried reading some of the same questions asked on