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")); }
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); }
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); }