My task is to cover the whole solution with tests and reach 100% branch and sequence coverage.
I have this two line of code with FirstOrDefault statement:
var error = response?.errors?.FirstOrDefault();
var summary = response.Profile?.FirstOrDefault()?.summary?
I have been able to check only 3 scenarios for above both lines even though Fine Code Coverage show yellow and not covered. Is there any test scenario I am missing to reach 100% for the above code.
Error Test Case.
1.when errors is not null.
2.when errors is null.
3.when errors count is 0 with no data.
Summary Test Case.
1.when summary is not null.
2.when summary is null.
3.when summary count is 0 with no data.
4.when Profile is Null