Пример #1
0
        protected override Task WhenAsync()
        {
            SystemUnderTest.AddMessagePublisher <Message>(_publisher, string.Empty);
            SystemUnderTest.AddMessagePublisher <Message>(_publisher, string.Empty);

            return(Task.CompletedTask);
        }
Пример #2
0
        protected override async Task WhenAsync()
        {
            SystemUnderTest.AddMessagePublisher <SimpleMessage>(_publisher, string.Empty);
            await SystemUnderTest.StartAsync(CancellationToken.None);

            await SystemUnderTest.PublishAsync(new SimpleMessage());
        }
Пример #3
0
 protected override void When()
 {
     SystemUnderTest.AddMessagePublisher <OrderAccepted>(_publisher, string.Empty);
     SystemUnderTest.AddMessagePublisher <OrderRejected>(_publisher, string.Empty);
     SystemUnderTest.Publish(new OrderAccepted());
     SystemUnderTest.Publish(new OrderRejected());
     SystemUnderTest.Publish(new OrderRejected());
 }
Пример #4
0
        protected override async Task WhenAsync()
        {
            SystemUnderTest.AddMessagePublisher <SimpleMessage>(_publisher);

            var cts = new CancellationTokenSource(TimeoutPeriod);
            await SystemUnderTest.StartAsync(cts.Token);

            await SystemUnderTest.PublishAsync(new SimpleMessage());
        }
        protected override async Task WhenAsync()
        {
            SystemUnderTest.AddMessagePublisher <SimpleMessage>(_publisher);

            using var cts = new CancellationTokenSource(TimeSpan.FromSeconds(3));
            await SystemUnderTest.StartAsync(cts.Token);

            await SystemUnderTest.PublishAsync(new SimpleMessage());
        }
Пример #6
0
        protected override async Task WhenAsync()
        {
            SystemUnderTest.AddMessagePublisher <OrderAccepted>(_publisher, string.Empty);
            SystemUnderTest.AddMessagePublisher <OrderRejected>(_publisher, string.Empty);

            await SystemUnderTest.PublishAsync(new OrderAccepted());

            await SystemUnderTest.PublishAsync(new OrderRejected());

            await SystemUnderTest.PublishAsync(new OrderRejected());
        }
        protected override Task WhenAsync()
        {
            SystemUnderTest.AddMessagePublisher <SimpleMessage>(Substitute.For <IMessagePublisher>(), string.Empty);

            return(Task.CompletedTask);
        }
Пример #8
0
        protected override async Task When()
        {
            SystemUnderTest.AddMessagePublisher <SimpleMessage>(_publisher, string.Empty);

            await SystemUnderTest.PublishAsync(new SimpleMessage());
        }
Пример #9
0
        protected override void When()
        {
            SystemUnderTest.AddMessagePublisher <GenericMessage>(_publisher, string.Empty);

            SystemUnderTest.Publish(new GenericMessage());
        }
 protected override void When()
 {
     SystemUnderTest.AddMessagePublisher <GenericMessage>(Substitute.For <IMessagePublisher>(), string.Empty);
 }
 protected override void When()
 {
     SystemUnderTest.AddMessagePublisher <Message>(null);
     SystemUnderTest.AddMessagePublisher <Message>(null);
 }
Пример #12
0
 protected override void When()
 {
     SystemUnderTest.AddMessagePublisher <Message>(_publisher, string.Empty);
     SystemUnderTest.AddMessagePublisher <Message>(_publisher, string.Empty);
 }