public void GetCountries_GetCountriesFromNonEmptyTable_ReturnsTableWithList() { ICountryDAL countryDAL = new CountryDAL(new DBService(new DbConnectionService(_connectionStringName))); List <ICountry> countryList = countryDAL.GetCountries().ToList(); Assert.IsTrue(countryList.Count() == DbSeeder.countryList.Count()); }
public void GetCountries_GetCountriesFromEmptyTable_ReturnsEmptyTable() { _dbSeeder.EmptyTables(); ICountryDAL countryDAL = new CountryDAL(new DBService(new DbConnectionService(_connectionStringName))); IEnumerable <ICountry> countryList = countryDAL.GetCountries(); Assert.IsTrue(countryList.Count() == 0); }
public ResultBM GetCountries() { try { CountryDAL countryDal = new CountryDAL(); List <CountryDTO> countriesDto = countryDal.GetCountries(); List <CountryBM> countriesBm = ConvertIntoBusinessModel(countriesDto); return(new ResultBM(ResultBM.Type.OK, "Recuperación de registros exitosa.", countriesBm)); } catch (Exception exception) { return(new ResultBM(ResultBM.Type.EXCEPTION, SessionHelper.GetTranslation("RETRIEVING_ERROR") + " " + exception.Message, exception)); } }
private void ContractorManagement_Load(object sender, EventArgs e) { ContractorDAL contractor = new ContractorDAL(); _contractorsDs = contractor.getContractorsPresentationDs(); DataView dv = _contractorsDs.Tables[0].DefaultView; dv.RowFilter = "IsDeleted = 0"; dgContractors.DataSource = dv; combCountries.DataSource = CountryDAL.GetCountries(); btAddNewContractor.Focus(); _contractorAdapter = contractor.getContractorAdapter(); this.dgContractors.SelectionChanged += new EventHandler(dgContractors_SelectionChanged); isDirty = false; }
public List <Country> GetCountries() { CountryDAL dbCountry = new CountryDAL(); return(dbCountry.GetCountries()); }
public List <CountryEN> GetCountries() { var result = countryDAL.GetCountries(); return(result); }