コード例 #1
0
 private void VerifyCurrentOrderExists(Customer currentCustomer)
 {
     if (currentCustomer.getOrder() == null)
     {
         throw new InvalidOperationException("Order not started");
     }
 }
コード例 #2
0
 public void StartNewOrder(Customer customer)
 {
     if (customer.getOrder() != null)
     {
         throw new InvalidOperationException("Cannot start a new order while another is still in progress");
     }
     customer.Order = new Order(currentStock);
 }