Beispiel #1
0
        public async Task Should_resolve_all_apps_from_user_permissions()
        {
            var expected = SetupApp(0, false);

            A.CallTo(() => indexByName.GetIdsAsync(A <string[]> .That.IsSameSequenceAs(new string[] { appId.Name })))
            .Returns(new List <Guid> {
                appId.Id
            });

            var actual = await sut.GetAppsForUserAsync(userId, new PermissionSet($"squidex.apps.{appId.Name}"));

            Assert.Same(expected, actual[0]);
        }
Beispiel #2
0
        public async Task Should_resolve_all_apps_from_user_permissions()
        {
            var(expected, _) = CreateApp();

            A.CallTo(() => cache.GetAppIdsAsync(A <string[]> .That.Is(appId.Name)))
            .Returns(new List <DomainId> {
                appId.Id
            });

            var actual = await sut.GetAppsForUserAsync(userId, new PermissionSet($"squidex.apps.{appId.Name}"));

            Assert.Same(expected, actual[0]);
        }