private static Daily ParseDaily(PropertyDictionary properties, PropertyDescriptionDictionary descriptions)
        {
            var period = DayPeriod.Parse(properties.Get(PropertyNames.Day));

            return(Daily.Create(
                       properties.Get(PropertyNames.Ticker),
                       period,
                       properties,
                       descriptions
                       ));
        }
        private static Quarter ParseQuarter(
            PropertyDictionary properties,
            PropertyDescriptionDictionary descriptions)
        {
            var fiscalYear    = Convert.ToUInt16(properties.Get(PropertyNames.FiscalYear));
            var fiscalQuarter = Convert.ToUInt16(properties.Get(PropertyNames.FiscalQuarter));

            return(Quarter.Create(
                       properties.Get(PropertyNames.Ticker),
                       fiscalYear,
                       fiscalQuarter,
                       properties,
                       descriptions
                       ));
        }
        private static Company ParseCompany(
            PropertyDictionary properties,
            PropertyDescriptionDictionary descriptions)
        {
            var fixedTierRangeJson = JObject.Parse(properties.Get(PropertyNames.FixedTierRange));
            var fixedTierRange     = FixedTierRangeParser.Parse(fixedTierRangeJson.Properties());

            var oldestFy = uint.Parse(properties.Get(PropertyNames.OldestFiscalYear));
            var oldestFq = uint.Parse(properties.Get(PropertyNames.OldestFiscalQuarter));

            var latestFy   = uint.Parse(properties.Get(PropertyNames.LatestFiscalYear));
            var latestFq   = uint.Parse(properties.Get(PropertyNames.LatestFiscalQuarter));
            var oldestDate = DayPeriod.Parse(properties.Get(PropertyNames.OldestDate));
            // use today as latest date
            var latestDate = DayPeriod.Create(DateTime.Today);

            var fixedTierQuarterRange = PeriodRange <FiscalQuarterPeriod> .Create(fixedTierRange.OldestQuarter, fixedTierRange.LatestQuarter);

            var fixedTierDayRange = PeriodRange <DayPeriod> .Create(fixedTierRange.OldestDate, fixedTierRange.LatestDate);

            var ondemandPeriodRange = PeriodRange <FiscalQuarterPeriod> .Create(
                FiscalQuarterPeriod.Create(oldestFy, oldestFq),
                FiscalQuarterPeriod.Create(latestFy, latestFq)
                );

            var ondemandTierDayRange = PeriodRange <DayPeriod> .Create(oldestDate, latestDate);

            return(Company.Create(
                       properties.Get(PropertyNames.Ticker),
                       fixedTierQuarterRange,
                       ondemandPeriodRange,
                       fixedTierDayRange,
                       ondemandTierDayRange,
                       properties,
                       descriptions
                       ));
        }
示例#4
0
        public void GetTest()
        {
            var container = new PropertyDictionary(properties);

            Assert.AreEqual("value", container.Get("key"));
        }