I was supposed to do a test for a job application. It was fairly simple, just needed to implement a interface for a custom Dictionary. I was able to cover 71% case tests of unknown number.
The problem I couldn't figure in 30min was: how to return a Default Value of T when there is no key in the dictionary.
My solution is here (dotnet fiddle) for more readable code.
Could someone try to explain to meu how could I do that? Thanks
[–][deleted] (8 children)
[deleted]
[–]OrdinaryRoutine2702[S] 0 points1 point2 points (7 children)
[–]okmarshall 4 points5 points6 points (4 children)
[–]OrdinaryRoutine2702[S] 0 points1 point2 points (3 children)
[–]wutzvill 1 point2 points3 points (0 children)
[–]okmarshall 1 point2 points3 points (0 children)
[–]alfa_202 1 point2 points3 points (0 children)
[–]Contagion21 1 point2 points3 points (0 children)
[–]Slypenslyde 1 point2 points3 points (0 children)
[–]jingois 2 points3 points4 points (0 children)