public void Pe_Ratio_Throws_Exception_When_Dividend_Is_Zero_And_Double()
        {
            ArgumentException ex = Assert.Throws <ArgumentException>(() =>
                                                                     { MathFormulaCalculations.PeRatio(10, 0.0); });

            Assert.Equal("Price or Divident cannot be zero!", ex.Message);
        }
 public void Pe_Ratio_Returns_Result_When_Params_Are_Valid()
 {
     //Result should be 10/1 = 10
     Assert.Equal(10, MathFormulaCalculations.PeRatio(10, 1));
     //Result should be 10/2 = 5
     Assert.Equal(5, MathFormulaCalculations.PeRatio(10, 2));
 }
Exemplo n.º 3
0
 public double CalculatePeRatio(double price)
 {
     return(MathFormulaCalculations.PeRatio(price, CalculateDividendYield(price)));
 }