public RegisterAsyncStore ( IAsyncCacheStore store ) : void | ||
store | IAsyncCacheStore | |
return | void |
public void RegisterStore_should_throw_exception_if_duplicated_async_store_id() { var store = Substitute.For<ICacheStore>(); store.StoreId.Returns(10); var asyncStore = Substitute.For<IAsyncCacheStore>(); asyncStore.StoreId.Returns(10); var provider = new DefaultCacheStoreProvider(); provider.RegisterAsyncStore(asyncStore); Assert.Throws<InvalidOperationException>(() => provider.RegisterStore(store)); }
public void RegisterAsyncStore_should_register_both_type_and_id() { var store = Substitute.For<IAsyncCacheStore>(); store.StoreId.Returns(10); var provider = new DefaultCacheStoreProvider(); Assert.Throws<ArgumentNullException>(() => provider.RegisterAsyncStore(null)); provider.RegisterAsyncStore(store); Assert.IsNotNull(provider.GetAsyncCacheStore(10)); Assert.IsNotNull(provider.GetAsyncCacheStore(store.GetType())); }