/// <summary> /// <see cref="Microsoft.Samples.NLayerApp.Application.MainModule.CustomersManagement.ICustomerManagementService"/> /// </summary> /// <param name="customerCode"><see cref="Microsoft.Samples.NLayerApp.Application.MainModule.CustomersManagement.ICustomerManagementService"/></param> /// <returns><see cref="Microsoft.Samples.NLayerApp.Application.MainModule.CustomersManagement.ICustomerManagementService"/></returns> public Customer FindCustomerByCode(string customerCode) { //Create specification CustomerCodeSpecification spec = new CustomerCodeSpecification(customerCode); return(_customerRepository.FindCustomer(spec)); }
public void FindCustomer_Invoke_Test() { //Arrange string customerCode = "A0004"; IMainModuleUnitOfWork context = GetUnitOfWork(); ITraceManager traceManager = this.GetTraceManager(); ICustomerRepository repository = new CustomerRepository(context, traceManager); CustomerCodeSpecification spec = new CustomerCodeSpecification(customerCode); //Act Customer customer = repository.FindCustomer(spec); //Assert Assert.IsNotNull(customer); Assert.IsNotNull(customer.CustomerPicture); }
/// <summary> /// <see cref="Microsoft.Samples.NLayerApp.Application.MainModule.CustomersManagement.ICustomerManagementService"/> /// </summary> /// <param name="customerCode"><see cref="Microsoft.Samples.NLayerApp.Application.MainModule.CustomersManagement.ICustomerManagementService"/></param> /// <returns><see cref="Microsoft.Samples.NLayerApp.Application.MainModule.CustomersManagement.ICustomerManagementService"/></returns> public Customer FindCustomerByCode(string customerCode) { //Create specification CustomerCodeSpecification spec = new CustomerCodeSpecification(customerCode); return _customerRepository.FindCustomer(spec); }