public void ThrowsExceptionGivenAddressHasEmptyStreet1(string street1)
        {
            var address = _addressBuilder
                          .WithTestValues()
                          .Street1(street1)
                          .Build();

            var customer = _customerBuilder
                           .WithTestValues()
                           .Address(address)
                           .Build();

            var order = _orderBuilder
                        .WithTestValues()
                        .Customer(customer)
                        .Build();

            Assert.Throws <InvalidAddressException>(() => _orderService.PlaceOrder(order));
        }
예제 #2
0
        public void ThrowsExceptionIfAddressStreetIsNullOrEmpty(string input)
        {
            var address = _addressBuilder
                          .WithTestValues()
                          .Street1(input)
                          .Build();

            var customer = _customerBuilder
                           .WithTestValues()
                           .Address(address)
                           .Build();

            var order = _orderBuilder
                        .WithTestValues()
                        .Customer(customer)
                        .Build();

            Assert.Throws <InvalidAddressException>(() => _orderService.PlaceOrder(order));
        }