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.
41 lines
1.1 KiB
41 lines
1.1 KiB
// ==========================================================================
|
|
// DefaultEventNotifierTests.cs
|
|
// Squidex Headless CMS
|
|
// ==========================================================================
|
|
// Copyright (c) Squidex Group
|
|
// All rights reserved.
|
|
// ==========================================================================
|
|
|
|
using Xunit;
|
|
|
|
namespace Squidex.Infrastructure.CQRS.Events
|
|
{
|
|
public sealed class DefaultEventNotifierTests
|
|
{
|
|
private readonly DefaultEventNotifier sut = new DefaultEventNotifier(new InMemoryPubSub());
|
|
|
|
[Fact]
|
|
public void Should_invalidate_all_actions()
|
|
{
|
|
var handler1Handled = 0;
|
|
var handler2Handled = 0;
|
|
|
|
sut.Subscribe(() =>
|
|
{
|
|
handler1Handled++;
|
|
});
|
|
|
|
sut.NotifyEventsStored();
|
|
|
|
sut.Subscribe(() =>
|
|
{
|
|
handler2Handled++;
|
|
});
|
|
|
|
sut.NotifyEventsStored();
|
|
|
|
Assert.Equal(2, handler1Handled);
|
|
Assert.Equal(1, handler2Handled);
|
|
}
|
|
}
|
|
}
|
|
|