Exemplo n.º 1
0
 public void getValue()
 {
     Assert.AreEqual(constantIndicator.GetValue(0), 30.33M);
     Assert.AreEqual(constantIndicator.GetValue(1), 30.33M);
     Assert.AreEqual(constantIndicator.GetValue(10), 30.33M);
     Assert.AreEqual(constantIndicator.GetValue(30), 30.33M);
 }
Exemplo n.º 2
0
 public void ConstantIndicator()
 {
     TaTestsUtils.AssertDecimalEquals(_constantIndicator.GetValue(0), "30.33");
     TaTestsUtils.AssertDecimalEquals(_constantIndicator.GetValue(1), "30.33");
     TaTestsUtils.AssertDecimalEquals(_constantIndicator.GetValue(10), "30.33");
     TaTestsUtils.AssertDecimalEquals(_constantIndicator.GetValue(30), "30.33");
 }
Exemplo n.º 3
0
        public void GetValueWithNullTimeSeries()
        {
            var constant = new ConstantIndicator <Decimal>(Decimal.Ten);

            Assert.AreEqual(Decimal.Ten, constant.GetValue(0));
            Assert.AreEqual(Decimal.Ten, constant.GetValue(100));
            Assert.IsNull(constant.TimeSeries);

            var sma = new SmaIndicator(constant, 10);

            Assert.AreEqual(Decimal.Ten, sma.GetValue(0));
            Assert.AreEqual(Decimal.Ten, sma.GetValue(100));
            Assert.IsNull(sma.TimeSeries);
        }
Exemplo n.º 4
0
        public void getValueWithNullTimeSeries()
        {
            ConstantIndicator <decimal> constant = new ConstantIndicator <decimal>(Decimals.TEN);

            Assert.AreEqual(Decimals.TEN, constant.GetValue(0));
            Assert.AreEqual(Decimals.TEN, constant.GetValue(100));
            Assert.IsNull(constant.TimeSeries);

            SMAIndicator sma = new SMAIndicator(constant, 10);

            Assert.AreEqual(Decimals.TEN, sma.GetValue(0));
            Assert.AreEqual(Decimals.TEN, sma.GetValue(100));
            Assert.IsNull(sma.TimeSeries);
        }