public void EditUpdatesCustomerAndSaves()
        {
            Customer customer = new Customer();
            controller.Edit(customer);

            customerService.Received().InsertOrUpdate(customer);
            customerService.Received().Save();
        }
Пример #2
0
 public void InsertOrUpdate(Customer customer)
 {
     if (customer.ID == default(int))
     {
         this.context.Customers.Add(customer);
     }
     else
     {
         this.context.Entry(customer).State = EntityState.Modified;
     }
 }
 public void InsertOrUpdate(Customer customer)
 {
     this.IsInsertOrUpdateCalled = true;
 }
 public string GetCustomerSummary(Customer customer)
 {
     return string.Format("{0}, {1}", customer.FullName, customer.Address.City);
 }