Exemple #1
0
 public void Edit_InvalidIdSupplied_CustomerEdit()
 {
     var customer = GetCustomerToEdit();
     var customerRepositoryMock = MockRepository.GenerateMock<ICustomerRepository>();
     customerRepositoryMock.Stub(x => x.GetById(Guid.NewGuid())).Return(null);
     _customerService = CustomerServiceFactory.Create(customerRepositoryMock);
     _customerService.Edit(
         customer.Id, "Gael Ltd", GetAddressDetails("Trading"), GetContactInfo("Trading"),
         "Gael Ltd Invoice Address", GetAddressDetails("Invoicing"), GetContactInfo("Invoicing"),
         "Gael Ltd Delivery Address", GetAddressDetails("Delivery"), GetContactInfo("Delivery"));
 }
Exemple #2
0
 public void Edit_SuccessfullyEditCustomer_CustomerEdit()
 {
     var customer = GetCustomerToEdit();
     var customerRepositoryMock = MockRepository.GenerateMock<ICustomerRepository>();
     customerRepositoryMock.Expect(x => x.Update(null)).IgnoreArguments();
     customerRepositoryMock.Stub(x => x.GetById(customer.Id)).Return(customer);
     _customerService = CustomerServiceFactory.Create(customerRepositoryMock);
     _customerService.Edit(
         customer.Id, "Gael Ltd", GetAddressDetails("Trading"), GetContactInfo("Trading"),
         "Gael Ltd Invoice Address", GetAddressDetails("Invoicing"), GetContactInfo("Invoicing"),
         "Gael Ltd Delivery Address", GetAddressDetails("Delivery"), GetContactInfo("Delivery"));
     customerRepositoryMock.VerifyAllExpectations();
 }