public void GetAllCostIncomeTypesTest() { CostIncomeType costIncomeType = new CostIncomeType(connManager); DataSet ds = costIncomeType.GetAll(); Assert.AreEqual(3, ds.Tables[0].Columns.Count); }
/// <summary> /// Returns a list containing the 7 default accounts that are added to each inergy country when it is added in the db /// </summary> /// <param name="connectionManager"></param> /// <returns></returns> public static List <CostIncomeType> GetDefaultAccounts(object connectionManager) { List <CostIncomeType> defaultAccounts = new List <CostIncomeType>(); try { CostIncomeType costIncomeType = new CostIncomeType(connectionManager); DataSet dsDefaultAccounts = costIncomeType.GetAll(); foreach (DataRow row in dsDefaultAccounts.Tables[0].Rows) { costIncomeType = new CostIncomeType(row, connectionManager); defaultAccounts.Add(costIncomeType); } } catch (Exception ex) { throw new IndException(ex); } return(defaultAccounts); }