Esempio n. 1
0
        public void NotifyOfOrderFailureAsyncValidatesTheOrder(string orderId)
        {
            var notifier = new UnderTest.EmailNotifier(new EmailNotifierConfiguration(), Mock.Of <ILogger>());

            Action actionUnderTest = () => notifier.NotifyOfOrderFailureAsync("Bob", orderId, "blue").GetAwaiter().GetResult();

            actionUnderTest.ShouldThrow <ArgumentException>("because the orderId is required").And.ParamName.Should().Be(nameof(orderId), "because the orderId was invalid");
        }
Esempio n. 2
0
        public void NotifyDeadLetterMessageAsyncValidatesThePartner(string partner)
        {
            var notifier = new UnderTest.EmailNotifier(new EmailNotifierConfiguration(), Mock.Of <ILogger>());

            Action actionUnderTest = () => notifier.NotifyDeadLetterMessageAsync("ProcessOrder", partner, "ABC", "blue").GetAwaiter().GetResult();

            actionUnderTest.ShouldThrow <ArgumentException>("because the partner is required").And.ParamName.Should().Be(nameof(partner), "because the partner was invalid");
        }