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

            A.CallTo(() => urlGenerator.SchemasUI(appId))
            .Returns("schemas-url");

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

            result.Should().BeEquivalentTo(
                new SearchResults()
                .Add("Schemas", SearchResultType.Schema, "schemas-url"));
        }
Ejemplo n.º 2
0
        public async Task Should_return_schemas_result_if_matching_and_permission_given()
        {
            var permission = Permissions.ForApp(Permissions.AppSchemasRead, appId.Name);

            var ctx = ContextWithPermission(permission.Id);

            A.CallTo(() => urlGenerator.SchemasUI(appId))
            .Returns("schemas-url");

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

            result.Should().BeEquivalentTo(
                new SearchResults()
                .Add("Schemas", SearchResultType.Schema, "schemas-url"));
        }