public async Task Should_always_return_dashboard_result_if_matching()
        {
            var ctx = ContextWithPermission();

            A.CallTo(() => urlGenerator.DashboardUI(appId))
            .Returns("dashboard-url");

            var result = await sut.SearchAsync("dashboard", ctx);

            result.Should().BeEquivalentTo(
                new SearchResults()
                .Add("Dashboard", SearchResultType.Dashboard, "dashboard-url"));
        }
Exemplo n.º 2
0
        public async Task Should_return_dashboard_result_if_matching_and_permission_given()
        {
            var permission = Permissions.ForApp(Permissions.AppUsage, appId.Name);

            var ctx = ContextWithPermission(permission.Id);

            A.CallTo(() => urlGenerator.DashboardUI(appId))
            .Returns("dashboard-url");

            var result = await sut.SearchAsync("dashboard", ctx, default);

            result.Should().BeEquivalentTo(
                new SearchResults()
                .Add("Dashboard", SearchResultType.Dashboard, "dashboard-url"));
        }