Blog.Logic.Caching.Tests.CacheTest.ShouldThrowExceptionWhenGetAllCachedItemsFails C# (CSharp) Méthode

ShouldThrowExceptionWhenGetAllCachedItemsFails() private méthode

private ShouldThrowExceptionWhenGetAllCachedItemsFails ( ) : void
Résultat void
        public void ShouldThrowExceptionWhenGetAllCachedItemsFails()
        {
            _cacheDataSource = new Mock<ICacheDataSource<DummyModel>>();
            _cacheDataSource.Setup(a => a.GetList()).Throws(new Exception());

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

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