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

ShouldThrowExceptionWhenSetListFails() private method

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

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

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