[ISSUE] Add logger to colorable on fallBack #62
Merged
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.
Introduction
Our Colorable protocol helps users load (and unit test) colors from asset catalogs. It provides a fallback color to use in case the named color asset cannot be found. In that case though we should log a warning message.
Extract the code that builds name from namespace + rawValue into an internal calculateName() method and cover it in unit tests.
In ColorableTests try to minimize use of logger. Ideally log only one message before disabling the logging for remainder of failure cases
Purpose
Add logger to colorable protocol and add unit test for above scenarios.
Fix #55
Scope
Colorable protocol and Unit test for same protocol.
📈 Coverage
Code
100%
![Code coverage](https://user-images.githubusercontent.com/111066844/231075793-47412b1b-2274-438e-917f-8fc1e7bcf03f.png)
Documentation
100%
![Jazzy](https://user-images.githubusercontent.com/111066844/231063530-13eab8bc-9f70-4345-8be4-a05891214112.png)