public void Should_Parse_DailyWeeklyMonthlyMessage_With_Large_PeriodVolume()
        {
            // Arrange
            var message = $"2018-04-27,164.3300,160.6300,164.0000,162.3200,{long.MaxValue},0,";

            // Act
            var dailyWeeklyMonthlyMessage = DailyWeeklyMonthlyMessage.Parse(message);

            // Assert
            Assert.AreEqual(dailyWeeklyMonthlyMessage.PeriodVolume, long.MaxValue);
        }
        public void Should_Parse_DailyWeeklyMonthlyMessage_Invariant(string cultureName)
        {
            // Arrange
            TestHelper.SetThreadCulture(cultureName);

            // Act
            var dailyWeeklyMonthlyMessage = DailyWeeklyMonthlyMessage.Parse(_message);

            // Assert
            Assert.AreEqual(dailyWeeklyMonthlyMessage, _expectedMessage);
        }
        public void Should_Parse_DailyWeeklyMonthlyMessage_Culture_Independant(string cultureName)
        {
            // Arrange
            TestHelper.SetThreadCulture(cultureName);
            var message = "2018-04-27,164.3300,160.6300,164.0000,162.3200,35655839,0,";

            // Act
            var dailyWeeklyMonthlyMessage           = new DailyWeeklyMonthlyMessage(new DateTime(2018, 04, 27), 164.33f, 160.63f, 164f, 162.32f, 35655839, 0);
            var dailyWeeklyMonthlyMessageFromValues = DailyWeeklyMonthlyMessage.Parse(message);

            // Assert
            Assert.AreEqual(dailyWeeklyMonthlyMessage, dailyWeeklyMonthlyMessageFromValues);
        }
        private Func <string, HistoricalData> GetParseFunc(DataType dataType)
        {
            switch (dataType)
            {
            case DataType.Fundamental:
                return(FundamentalData.Parse);

            case DataType.Daily:
                return(line => new HistoricalData(DailyWeeklyMonthlyMessage.Parse(line).Timestamp, line));;

            default:
                throw new NotSupportedException();
            }
        }
        private IEnumerable <HistoricalData> GetData(MarketRequest request, string filename)
        {
            switch (request.DataType)
            {
            case DataType.Tick:
                return(LookupMessageFileParser.ParseFromFile(line => new HistoricalData(TickMessage.Parse(line).Timestamp, line), filename));

            case DataType.Daily:
                return(LookupMessageFileParser.ParseFromFile(line => new HistoricalData(DailyWeeklyMonthlyMessage.Parse(line).Timestamp, line), filename));

            default:
                throw new NotSupportedException();
            }
        }