Exemple #1
0
        public void NextCheck_BonusTrue_EmitsBonusAdded()
        {
            var res = Some.EventStatusResponse() with {
                Status = Some.EventStatusListWithoutAnythingAdded()
            };
            var res2 = Some.EventStatusResponse() with {
                Status = Some.EventStatusListBonusTrue()
            };

            A.CallTo(() => EventStatusClient.GetEventStatus()).Returns(value: res).Once().Then.Returns(res2);

            var monitor = CreateMatchDayStatusMonitor();

            monitor.EveryFiveMinutesTick(CancellationToken.None);
            monitor.EveryFiveMinutesTick(CancellationToken.None);

            A.CallTo(() => Mediator.Publish(A <BonusAdded> ._, CancellationToken.None)).MustHaveHappenedOnceExactly();
        }
    public void NextCheck_BonusTrue_EmitsBonusAdded()
    {
        var res = Some.EventStatusResponse() with {
            Status = Some.EventStatusListWithoutAnythingAdded()
        };
        var res2 = Some.EventStatusResponse() with {
            Status = Some.EventStatusListBonusTrue()
        };

        A.CallTo(() => EventStatusClient.GetEventStatus()).Returns(value: res).Once().Then.Returns(res2);

        var monitor = CreateMatchDayStatusMonitor();

        monitor.EveryFiveMinutesTick(CancellationToken.None);
        monitor.EveryFiveMinutesTick(CancellationToken.None);

        Assert.Single(Mediator.PublishedMessages);
        Assert.IsType <MatchdayBonusPointsAdded>(Mediator.PublishedMessages[0].Message);
    }