Esempio n. 1
0
        public AssetQueryServiceTests()
        {
            requestContext = new Context(Mocks.FrontendUser(), Mocks.App(appId));

            var options = Options.Create(new AssetOptions {
                DefaultPageSize = 30
            });

            sut = new AssetQueryService(tagService, assetEnricher, assetRepository, options);
        }
Esempio n. 2
0
        public AssetQueryServiceTests()
        {
            var user = new ClaimsPrincipal(new ClaimsIdentity());

            A.CallTo(() => app.Id).Returns(appId.Id);
            A.CallTo(() => app.Name).Returns(appId.Name);
            A.CallTo(() => app.LanguagesConfig).Returns(LanguagesConfig.English);

            context = QueryContext.Create(app, user);

            var options = Options.Create(new AssetOptions {
                DefaultPageSize = 30
            });

            sut = new AssetQueryService(tagService, assetEnricher, assetRepository, options);
        }
        public AssetQueryServiceTests()
        {
            var user = new ClaimsPrincipal(identity);

            A.CallTo(() => app.Id).Returns(appId);
            A.CallTo(() => app.Name).Returns(appName);
            A.CallTo(() => app.LanguagesConfig).Returns(LanguagesConfig.English);

            context = QueryContext.Create(app, user);

            A.CallTo(() => tagService.DenormalizeTagsAsync(appId, TagGroups.Assets, A <HashSet <string> > .That.IsSameSequenceAs("id1", "id2", "id3")))
            .Returns(new Dictionary <string, string>
            {
                ["id1"] = "name1",
                ["id2"] = "name2",
                ["id3"] = "name3"
            });

            sut = new AssetQueryService(tagService, assetRepository);
        }