mirror of https://github.com/Squidex/squidex.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
38 lines
1.2 KiB
38 lines
1.2 KiB
// ==========================================================================
|
|
// Squidex Headless CMS
|
|
// ==========================================================================
|
|
// Copyright (c) Squidex UG (haftungsbeschraenkt)
|
|
// All rights reserved. Licensed under the MIT license.
|
|
// ==========================================================================
|
|
|
|
using System;
|
|
using System.Threading.Tasks;
|
|
using FakeItEasy;
|
|
using Squidex.Domain.Apps.Entities.Apps.Commands;
|
|
using Squidex.Infrastructure.Commands;
|
|
using Xunit;
|
|
|
|
namespace Squidex.Domain.Apps.Entities.Apps.Templates
|
|
{
|
|
public class AlwaysCreateClientCommandMiddlewareTests
|
|
{
|
|
private readonly ICommandBus commandBus = A.Fake<ICommandBus>();
|
|
|
|
[Fact]
|
|
public async Task Should_create_client()
|
|
{
|
|
var command = new CreateApp { AppId = Guid.NewGuid() };
|
|
|
|
var context =
|
|
new CommandContext(command, commandBus)
|
|
.Complete();
|
|
|
|
var sut = new AlwaysCreateClientCommandMiddleware();
|
|
|
|
await sut.HandleAsync(context);
|
|
|
|
A.CallTo(() => commandBus.PublishAsync(A<AttachClient>.That.Matches(x => x.Id == "default")))
|
|
.MustHaveHappened();
|
|
}
|
|
}
|
|
}
|
|
|