You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
Refer to the logging in ImageAsset.image and SystemImage.image, except that we should use YCoreUI.colorLogger.
Log warning level message from Colorable.color if and only if returning the fallbackColor.
Don't log anything if YCoreUI.isLoggingEnabled == false
Use YCoreUI.colorLogger
Extract the code that builds name from namespace + rawValue into an internal calculateName() method and cover it in unit tests (see ImageAsset.calculateName() and associated unit tests for reference).
warning message must contain the full name from calculateName()
In ColorableTests try to minimize use of logger. Ideally log only one message before disabling the logging for remainder of failure cases (but re-enable it at end of tests). See ImageAssetTests and SystemImageTests.
Keep unit test coverage at 100%
The text was updated successfully, but these errors were encountered:
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.Refer to the logging in
ImageAsset.image
andSystemImage.image
, except that we should useYCoreUI.colorLogger
.Colorable.color
if and only if returning the fallbackColor.YCoreUI.isLoggingEnabled == false
YCoreUI.colorLogger
calculateName()
method and cover it in unit tests (seeImageAsset.calculateName()
and associated unit tests for reference).calculateName()
The text was updated successfully, but these errors were encountered: