public void GenerateStockName_StockTypeEquity_OnePlusExsitingEquity() { FundScreenViewModel viewmodel = new FundScreenViewModel(); Stock newStock = new Stock(); newStock.StockType = StockEnum.Equity; string newEquityName = viewmodel.GenerateStockName(StockEnum.Equity); int existingNoOfEquity = viewmodel.AllStocks.Where(c => c.StockType == StockEnum.Equity).Count(); Assert.AreEqual(newEquityName, "Equity" + (existingNoOfEquity + 1).ToString()); }
public void GenerateStockName_StockTypeBond_OnePlusExsitingBond() { FundScreenViewModel viewmodel = new FundScreenViewModel(); Stock newStock = new Stock(); newStock.StockType = StockEnum.Bond; string newBondName = viewmodel.GenerateStockName(StockEnum.Bond); int existingNoOfBond = viewmodel.AllStocks.Where(c => c.StockType == StockEnum.Bond).Count(); Assert.AreEqual(newBondName, "Bond" + (existingNoOfBond + 1).ToString()); }