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.
50 lines
1.5 KiB
50 lines
1.5 KiB
// ==========================================================================
|
|
// Squidex Headless CMS
|
|
// ==========================================================================
|
|
// Copyright (c) Squidex UG (haftungsbeschraenkt)
|
|
// All rights reserved. Licensed under the MIT license.
|
|
// ==========================================================================
|
|
|
|
using FakeItEasy;
|
|
using Orleans;
|
|
using Squidex.Domain.Apps.Entities.TestHelpers;
|
|
using Squidex.Infrastructure;
|
|
using Xunit;
|
|
|
|
namespace Squidex.Domain.Apps.Entities.Contents.Counter
|
|
{
|
|
public class CounterDeleterTests
|
|
{
|
|
private readonly IGrainFactory grainFactory = A.Fake<IGrainFactory>();
|
|
private readonly CounterDeleter sut;
|
|
|
|
public CounterDeleterTests()
|
|
{
|
|
sut = new CounterDeleter(grainFactory);
|
|
}
|
|
|
|
[Fact]
|
|
public void Should_run_with_default_order()
|
|
{
|
|
var order = ((IDeleter)sut).Order;
|
|
|
|
Assert.Equal(0, order);
|
|
}
|
|
|
|
[Fact]
|
|
public async Task Should_remove_events_from_streams()
|
|
{
|
|
var app = Mocks.App(NamedId.Of(DomainId.NewGuid(), "my-app"));
|
|
|
|
var grain = A.Fake<ICounterGrain>();
|
|
|
|
A.CallTo(() => grainFactory.GetGrain<ICounterGrain>(app.Id.ToString(), null))
|
|
.Returns(grain);
|
|
|
|
await sut.DeleteAppAsync(app, default);
|
|
|
|
A.CallTo(() => grain.ClearAsync())
|
|
.MustHaveHappened();
|
|
}
|
|
}
|
|
}
|
|
|