public void UpdateServicePrice(DtoAddCustomerService customerService) { var customer = _customerRepository.GetCustomer(customerService.CustomerId); var service = customer.Services.Single(x => x.ServiceId == customerService.ServiceId); service.Price = customerService.ServicePrice; }
public void UpdateServicePrice_should_update_service_price_to_customer() { var c = new DtoAddCustomerService() { CustomerId = _customerId, ServiceId = "C", ServicePrice = 0.8M }; _customer.Services.Add(new ServiceC(DateTime.Now)); _sut.UpdateServicePrice(c); Assert.That(_customer.Services.First(x => x.StartDate.Date == DateTime.Today).Price, Is.EqualTo(c.ServicePrice)); }
public ActionResult Patch(DtoAddCustomerService service) { _customerService.UpdateServicePrice(service); return(Ok()); }