示例#1
0
        public void EmptyStoreUpdateValues()
        {
            var field = new NormalizedBasicEPSGrowth();

            // update the default value
            var data = new Dictionary <string, decimal> {
                { QuantConnect.Data.Fundamental.Period.OneYear, 2 }
            };

            field.UpdateValues(new NormalizedBasicEPSGrowth(data));

            Assert.IsTrue(field.HasValue);
            Assert.AreEqual(2, field.Value);
            Assert.AreEqual(QuantConnect.Data.Fundamental.Period.OneYear, field.GetPeriodNames().Single());

            var values = field.GetPeriodValues();

            Assert.AreEqual(1, values.Count);
            Assert.AreEqual(2, values.First().Value);
            Assert.AreEqual(QuantConnect.Data.Fundamental.Period.OneYear, values.First().Key);
        }
示例#2
0
        public void UpdateValuesWithNull()
        {
            var field = new NormalizedBasicEPSGrowth();

            Assert.DoesNotThrow(() => field.UpdateValues(new NormalizedBasicEPSGrowth(null)));
        }