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.
39 lines
1.2 KiB
39 lines
1.2 KiB
// ==========================================================================
|
|
// Squidex Headless CMS
|
|
// ==========================================================================
|
|
// Copyright (c) Squidex UG (haftungsbeschraenkt)
|
|
// All rights reserved. Licensed under the MIT license.
|
|
// ==========================================================================
|
|
|
|
using FakeItEasy;
|
|
using Orleans;
|
|
using Squidex.Infrastructure.Orleans;
|
|
using Xunit;
|
|
|
|
namespace Squidex.Infrastructure.EventSourcing.Grains
|
|
{
|
|
public class OrleansEventNotifierTests
|
|
{
|
|
private readonly IEventConsumerManagerGrain manager = A.Fake<IEventConsumerManagerGrain>();
|
|
private readonly OrleansEventNotifier sut;
|
|
|
|
public OrleansEventNotifierTests()
|
|
{
|
|
var factory = A.Fake<IGrainFactory>();
|
|
|
|
A.CallTo(() => factory.GetGrain<IEventConsumerManagerGrain>(SingleGrain.Id, null))
|
|
.Returns(manager);
|
|
|
|
sut = new OrleansEventNotifier(factory);
|
|
}
|
|
|
|
[Fact]
|
|
public void Should_wakeup_manager_with_stream_name()
|
|
{
|
|
sut.NotifyEventsStored("my-stream");
|
|
|
|
A.CallTo(() => manager.ActivateAsync("my-stream"))
|
|
.MustHaveHappened();
|
|
}
|
|
}
|
|
}
|
|
|