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
To make testing easier and to follow SOLID principles your code should not depend on an instance of CachingService. Instead you should depend upon the interface IAppCache and use a dependency injection container to pass you an instance of CachingService at runtime.
In your unit tests you can then choose - either mock the interface yourself, pass an instance of MemoryCache and include it in your test coverage, or use the built in mock - see LazyCache/Mocks/MockCachingService.cs