/// <summary> /// <see cref="Microsoft.Samples.NLayerApp.Application.MainModule.BankingManagement.IBankingManagementService"/> /// </summary> /// <param name="bankAccountNumber"><see cref="Microsoft.Samples.NLayerApp.Application.MainModule.BankingManagement.IBankingManagementService"/></param> /// <param name="customerName"><see cref="Microsoft.Samples.NLayerApp.Application.MainModule.BankingManagement.IBankingManagementService"/></param> /// <returns><see cref="Microsoft.Samples.NLayerApp.Application.MainModule.BankingManagement.IBankingManagementService"/></returns> public List <BankAccount> FindBankAccounts(string bankAccountNumber, string customerName) { BankAccountSearchSpecification specification = new BankAccountSearchSpecification(bankAccountNumber, customerName); //query repository return(_bankAccountRepository.GetBySpec(specification as ISpecification <BankAccount>).ToList()); }
public void FindBanksAccounts_Invoke_AccountNumber_Test() { //Arrange IMainModuleUnitOfWork context = this.GetUnitOfWork(); ITraceManager traceManager = this.GetTraceManager(); BankAccountRepository repository = new BankAccountRepository(context, traceManager); BankAccountSearchSpecification spec = new BankAccountSearchSpecification(bankAccountNumber, null); //Act IEnumerable <BankAccount> actual; actual = repository.GetBySpec(spec); //Assert Assert.IsNotNull(actual); Assert.IsTrue(actual.Count() == 1); }
public void FindBanksAccounts_Invoke_CustomerName_Test() { //Arrange IMainModuleUnitOfWork context = this.GetUnitOfWork(); ITraceManager traceManager = this.GetTraceManager(); BankAccountRepository repository = new BankAccountRepository(context, traceManager); string name = "Unai"; BankAccountSearchSpecification spec = new BankAccountSearchSpecification(null, name); //Act IEnumerable <BankAccount> actual; actual = repository.GetBySpec(spec); //Assert Assert.IsNotNull(actual); }
/// <summary> /// <see cref="Microsoft.Samples.NLayerApp.Application.MainModule.BankingManagement.IBankingManagementService"/> /// </summary> /// <param name="bankAccountNumber"><see cref="Microsoft.Samples.NLayerApp.Application.MainModule.BankingManagement.IBankingManagementService"/></param> /// <param name="customerName"><see cref="Microsoft.Samples.NLayerApp.Application.MainModule.BankingManagement.IBankingManagementService"/></param> /// <returns><see cref="Microsoft.Samples.NLayerApp.Application.MainModule.BankingManagement.IBankingManagementService"/></returns> public List<BankAccount> FindBankAccounts(string bankAccountNumber, string customerName) { BankAccountSearchSpecification specification = new BankAccountSearchSpecification(bankAccountNumber, customerName); //query repository return _bankAccountRepository.GetBySpec(specification as ISpecification<BankAccount>).ToList(); }