This repository has been archived by the owner on Oct 21, 2018. It is now read-only.
Changed the default return value for methods that return a collection interface to return an instance of an empty collection #11
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This change tries to reduce the number of methods stubs needed to stub an object.
The reason why we use a stub is to communicate that the object is needed but does not act for the purpose that we want to test.
Currently, if there is a call to a method of a stub that returns a collection, the stub object will return a null that will probably cause a null reference exception.
We will have to add a stub espectation for the method even if it does not act on what we want to test.
It is usual that the real implementation of a method that return a collection, return a empty collection instead of a null.
Therefore, if the stub object returns an empty collection instead of a null, will be more similar to the real behavior of the real class, and in addition, it will prevent the need of additional stub calls.