示例#1
0
 public void can_get_string_representation_of_message()
 {
     _sut.ToString().ShouldContainText("ControlNumber");
     _sut.ControlNumber = "1234";
     _sut.ToString().ShouldContainText("1234");
     _sut.Customer = new Customer {
         CustomerName = "testCustomer"
     };
     _sut.ToString().ShouldContainText(_sut.Customer.CustomerName);
     _sut.AddAddress(new Address {
         City = "Austin", AddressType = AddressTypeConstants.ShipTo
     });
     _sut.ToString().ShouldContainText("Austin");
 }
示例#2
0
        public void can_notify_failure_of_CreateOrderMessage()
        {
            var message = new OrderRequestReceivedMessage {
                BusinessPartnerCode = "WWT"
            };
            var exception = new Exception("Test Exception");
            var fault     = new Fault <OrderRequestReceivedMessage>(message, exception);

            _sut.NotifyFailureOf(fault);

            _notificationSender.Verify(x => x.SendNotification(
                                           It.IsAny <string>(),
                                           It.Is <IList <EmailAddress> >(
                                               a =>
                                               a[0].Address ==
                                               EmailAddressConstants.InformationtechnologygroupEmailAddress &&
                                               a[1].Address == EmailAddressConstants.LogisticsEmailAddress),
                                           It.Is <string>(body => body.Contains(message.ToString()) &&
                                                          body.Contains(exception.ToString()))));
        }