Ejemplo n.º 1
0
        public void BuildCsv_builds_correctly_for_single_day()
        {
            // arrange
            var s = "GOOG";
            var start = new YahooMdy {Month = 0, Day = 4, Year = 2011};
            var end = new YahooMdy {Month = 0, Day = 4, Year = 2011};
            var expected = "http://ichart.yahoo.com/table.csv?s=GOOG&a=0&b=4&c=2011&d=0&e=4&f=2011&g=d&ignore=.csv";
            var builder = new UrlBuilder();

            // act
            var actual = builder.BuildCsvUrl(s, start, end);

            // assert
            Assert.That(actual, Is.EqualTo(expected));
        }
        public void GetResults_throws_NotFoundException_for_DJIA()
        {
            // arrange
            var start = RandomDateHelper.GetRandomRecentDate();
            var startMdy = start.ToMdy();
            var endMdy = startMdy.AddDays(4);
            var sy = new YahooMdy(startMdy);
            var ey = new YahooMdy(endMdy);

            const string identifier = "DJIA";

            var provider = new HistoricalStockDataCsvProvider();

            // act

            // assert
            Assert.Throws<NotFoundException>(() => provider.GetResults(identifier, sy, ey));
        }