Blog.Logic.Caching.Tests.CacheTest.ShouldThrowExceptionWhenGetCacheKeysFails C# (CSharp) Метод

ShouldThrowExceptionWhenGetCacheKeysFails() приватный Метод

private ShouldThrowExceptionWhenGetCacheKeysFails ( ) : void
Результат void
        public void ShouldThrowExceptionWhenGetCacheKeysFails()
        {
            _cacheDataSource = new Mock<ICacheDataSource<DummyModel>>();
            _cacheDataSource.Setup(a => a.GetKeys()).Throws(new Exception());

            var cache = new Cache<DummyModel>(_cacheDataSource.Object);

            Assert.Throws<BlogException>(() => cache.GetKeys());
        }