public NServiceBusHealthCheckTestsFixture SetSendSuccess()
        {
            MessageSession.Setup(s => s.Send(It.IsAny <RunHealthCheckCommand>(), It.IsAny <SendOptions>()))
            .Returns <RunHealthCheckCommand, SendOptions>((c, o) =>
            {
                MessageId = o.GetMessageId();

                if (string.IsNullOrWhiteSpace(MessageId))
                {
                    throw new ArgumentNullException(nameof(MessageId));
                }

                return(Task.CompletedTask);
            });

            return(this);
        }
        public NServiceBusHealthCheckTestsFixture SetSendFailure()
        {
            MessageSession.Setup(s => s.Send(It.IsAny <RunHealthCheckCommand>(), It.IsAny <SendOptions>())).ThrowsAsync(Exception);

            return(this);
        }
예제 #3
0
        public NServiceBusHealthCheckTestsFixture SetSendSuccess()
        {
            MessageSession.Setup(s => s.Send(It.IsAny <object>(), It.IsAny <SendOptions>())).Returns(Task.CompletedTask);

            return(this);
        }
 public NotificationsPublisherTestsFixtures SetupMessageSessionToThrowInvalidOperationException()
 {
     MessageSession.Setup(x => x.Send(It.IsAny <object>(), It.IsAny <SendOptions>())).Throws <InvalidOperationException>();
     return(this);
 }