コード例 #1
0
ファイル: AppsIndexTests.cs プロジェクト: lacc/squidex
        public AppsIndexTests()
        {
            A.CallTo(() => grainFactory.GetGrain <IAppsByNameIndexGrain>(SingleGrain.Id, null))
            .Returns(indexByName);

            A.CallTo(() => grainFactory.GetGrain <IAppsByUserIndexGrain>(userId, null))
            .Returns(indexByUser);

            sut = new AppsIndex(grainFactory);
        }
コード例 #2
0
        public AppsIndexTests()
        {
            A.CallTo(() => grainFactory.GetGrain <IAppsByNameIndexGrain>(SingleGrain.Id, null))
            .Returns(indexByName);

            A.CallTo(() => grainFactory.GetGrain <IAppsByUserIndexGrain>(userId, null))
            .Returns(indexByUser);

            var cache = new ReplicatedCache(new MemoryCache(Options.Create(new MemoryCacheOptions())), new SimplePubSub());

            sut = new AppsIndex(grainFactory, cache);
        }
コード例 #3
0
        public AppsIndexTests()
        {
            A.CallTo(() => grainFactory.GetGrain <IAppsCacheGrain>(SingleGrain.Id, null))
            .Returns(cache);

            var replicatedCache =
                new ReplicatedCache(new MemoryCache(Options.Create(new MemoryCacheOptions())), new SimplePubSub(A.Fake <ILogger <SimplePubSub> >()),
                                    Options.Create(new ReplicatedCacheOptions {
                Enable = true
            }));

            sut = new AppsIndex(appRepository, grainFactory, replicatedCache);
        }
コード例 #4
0
        public AppsIndexTests()
        {
            A.CallTo(() => grainFactory.GetGrain <IAppsByNameIndexGrain>(SingleGrain.Id, null))
            .Returns(indexByName);

            A.CallTo(() => grainFactory.GetGrain <IAppsByUserIndexGrain>(userId, null))
            .Returns(indexForUser);

            A.CallTo(() => grainFactory.GetGrain <IAppsByUserIndexGrain>(clientId, null))
            .Returns(indexForClient);

            var cache =
                new ReplicatedCache(new MemoryCache(Options.Create(new MemoryCacheOptions())), new SimplePubSub(A.Fake <ILogger <SimplePubSub> >()),
                                    Options.Create(new ReplicatedCacheOptions {
                Enable = true
            }));

            sut = new AppsIndex(grainFactory, cache);
        }