Example #1
0
 static void PrintOutput()
 {
     Console.WriteLine("*********************Super Simple Stock Market**********************");
     Console.WriteLine("Ticker\tPrice\tP/E\t     Div.Yield\t\tVW Stock Price");
     foreach (IStock stk in _stockService.LoadStockData())
     {
         var str = $"\n {stk.Ticker} \t {stk.LastPrice} \t {_stockService.CalcPERatio(stk)?.ToString()??"-"} \t\t {_stockService.CalcDividendYield(stk).ToString("P")} \t\t {_tradeService.CalculateVWStockPrice(stk.Ticker,15)}";
         Console.WriteLine(str);
     }
     Console.WriteLine($"\nGBCE All Share Index: {_stockService.CalcAllShareIndex()}");
 }
Example #2
0
        public void CalcDividendYieldNullTest()
        {
            var divyield = _mockService.CalcDividendYield(null);

            Assert.IsTrue(divyield == -1);
        }