Blog.Logic.Caching.Tests.CacheTest.ShouldThrowExceptionWhenRemoveAllCachedItemsFails C# (CSharp) Method

ShouldThrowExceptionWhenRemoveAllCachedItemsFails() private method

private ShouldThrowExceptionWhenRemoveAllCachedItemsFails ( ) : void
return void
        public void ShouldThrowExceptionWhenRemoveAllCachedItemsFails()
        {
            _cacheDataSource = new Mock<ICacheDataSource<DummyModel>>();
            _cacheDataSource.Setup(a => a.RemoveAll()).Throws(new Exception());

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

            Assert.Throws<BlogException>(cache.RemoveAll);
        }