示例#1
0
        public async Task Should_return_result_to_schema_only_if_user_has_no_permission()
        {
            var ctx = ContextWithPermission();

            var schema1 = CreateSchema("schemaA1", false);

            A.CallTo(() => appProvider.GetSchemasAsync(appId.Id))
            .Returns(new List <ISchemaEntity> {
                schema1
            });

            A.CallTo(() => urlGenerator.SchemaUI(appId, schema1.NamedId()))
            .Returns("schemaA1-url");

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

            result.Should().BeEquivalentTo(
                new SearchResults()
                .Add("schemaA1 Schema", SearchResultType.Schema, "schemaA1-url"));
        }
示例#2
0
        private void AddSchemaUrl(SearchResults result, NamedId <DomainId> appId, NamedId <DomainId> schemaId, string name)
        {
            var schemaUrl = urlGenerator.SchemaUI(appId, schemaId);

            result.Add(T.Get("search.schemaResult", new { name }), SearchResultType.Schema, schemaUrl);
        }
示例#3
0
        private void AddSchemaUrl(SearchResults result, NamedId <Guid> appId, NamedId <Guid> schemaId, string name)
        {
            var schemaUrl = urlGenerator.SchemaUI(appId, schemaId);

            result.Add($"{name} Schema", SearchResultType.Schema, schemaUrl);
        }