Browse Source

Bug fixes for broken merge.

pull/568/head
Sebastian 6 years ago
parent
commit
f38492ea17
  1. 2
      backend/src/Squidex.Domain.Apps.Entities/Apps/Indexes/AppsIndex.cs
  2. 2
      backend/src/Squidex.Domain.Apps.Entities/Schemas/Indexes/SchemasIndex.cs
  3. 4
      backend/tests/Squidex.Domain.Apps.Entities.Tests/Apps/Indexes/AppsIndexTests.cs
  4. 8
      backend/tests/Squidex.Domain.Apps.Entities.Tests/Schemas/Indexes/SchemasIndexTests.cs
  5. 2
      backend/tests/Squidex.Web.Tests/Pipeline/SchemaResolverTests.cs

2
backend/src/Squidex.Domain.Apps.Entities/Apps/Indexes/AppsIndex.cs

@ -237,7 +237,7 @@ namespace Squidex.Domain.Apps.Entities.Apps.Indexes
await RemoveContributorAsync(removeContributor);
break;
case ArchiveApp archiveApp:
case ArchiveApp _:
await ArchiveAppAsync(app);
break;
}

2
backend/src/Squidex.Domain.Apps.Entities/Schemas/Indexes/SchemasIndex.cs

@ -93,7 +93,7 @@ namespace Squidex.Domain.Apps.Entities.Schemas.Indexes
}
}
var schema = await GetSchemaCoreAsync(id);
var schema = await GetSchemaCoreAsync(DomainId.Combine(appId, id));
if (schema != null)
{

4
backend/tests/Squidex.Domain.Apps.Entities.Tests/Apps/Indexes/AppsIndexTests.cs

@ -311,6 +311,8 @@ namespace Squidex.Domain.Apps.Entities.Apps.Indexes
[Fact]
public async Task Should_add_app_to_index_on_contributor_assignment()
{
SetupApp();
var command = new AssignContributor { AppId = appId, ContributorId = userId };
var context =
@ -326,6 +328,8 @@ namespace Squidex.Domain.Apps.Entities.Apps.Indexes
[Fact]
public async Task Should_remove_from_user_index_on_remove_of_contributor()
{
SetupApp();
var command = new RemoveContributor { AppId = appId, ContributorId = userId };
var context =

8
backend/tests/Squidex.Domain.Apps.Entities.Tests/Schemas/Indexes/SchemasIndexTests.cs

@ -57,7 +57,7 @@ namespace Squidex.Domain.Apps.Entities.Schemas.Indexes
Assert.Same(expected, actual1);
Assert.Same(expected, actual2);
A.CallTo(() => grainFactory.GetGrain<ISchemaGrain>(schemaId.Id.ToString(), null))
A.CallTo(() => grainFactory.GetGrain<ISchemaGrain>(A<string>._, null))
.MustHaveHappenedTwiceExactly();
A.CallTo(() => index.GetIdAsync(A<string>._))
@ -80,7 +80,7 @@ namespace Squidex.Domain.Apps.Entities.Schemas.Indexes
Assert.Same(expected, actual2);
Assert.Same(expected, actual3);
A.CallTo(() => grainFactory.GetGrain<ISchemaGrain>(schemaId.Id.ToString(), null))
A.CallTo(() => grainFactory.GetGrain<ISchemaGrain>(A<string>._, null))
.MustHaveHappenedOnceExactly();
A.CallTo(() => index.GetIdAsync(A<string>._))
@ -98,7 +98,7 @@ namespace Squidex.Domain.Apps.Entities.Schemas.Indexes
Assert.Same(expected, actual1);
Assert.Same(expected, actual2);
A.CallTo(() => grainFactory.GetGrain<ISchemaGrain>(schemaId.Id.ToString(), null))
A.CallTo(() => grainFactory.GetGrain<ISchemaGrain>(A<string>._, null))
.MustHaveHappenedTwiceExactly();
A.CallTo(() => index.GetIdAsync(A<string>._))
@ -118,7 +118,7 @@ namespace Squidex.Domain.Apps.Entities.Schemas.Indexes
Assert.Same(expected, actual2);
Assert.Same(expected, actual3);
A.CallTo(() => grainFactory.GetGrain<ISchemaGrain>(schemaId.Id.ToString(), null))
A.CallTo(() => grainFactory.GetGrain<ISchemaGrain>(A<string>._, null))
.MustHaveHappenedOnceExactly();
A.CallTo(() => index.GetIdAsync(A<string>._))

2
backend/tests/Squidex.Web.Tests/Pipeline/SchemaResolverTests.cs

@ -66,7 +66,7 @@ namespace Squidex.Web.Pipeline
{
actionContext.RouteData.Values["name"] = schemaId.Id.ToString();
A.CallTo(() => appProvider.GetSchemaAsync(appId.Id, A<DomainId>._, false, false))
A.CallTo(() => appProvider.GetSchemaAsync(appId.Id, A<DomainId>._, false, true))
.Returns(Task.FromResult<ISchemaEntity?>(null));
await sut.OnActionExecutionAsync(actionExecutingContext, next);

Loading…
Cancel
Save