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")); }
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(); }