コード例 #1
0
        public void RemoveCategoryRemovesFromCacheTest()
        {
            var expected = Model.Create <Category>();
            var cacheKey = "Category|" + expected.Group + "|" + expected.Name;

            var cache  = Substitute.For <IMemoryCache>();
            var config = Substitute.For <ICacheConfig>();

            var sut = new CategoryCache(cache, config);

            sut.RemoveCategory(expected.Group, expected.Name);

            cache.Received().Remove(cacheKey);
        }