コード例 #1
0
        public void historical_valid_symbols_null_data_returns_prices()
        {
            using var client = new EODHistoricalDataClient(Consts.ApiToken, true);
            var prices = client.GetHistoricalPrices(Consts.TestSymbolNullData, null, null);

            Assert.IsTrue(prices.Count > 0);
        }
コード例 #2
0
        public void historical_valid_symbols_returns_empty()
        {
            EODHistoricalDataClient client = new EODHistoricalDataClient(Consts.ApiToken, true);
            List <HistoricalPrice>  prices = client.GetHistoricalPrices(Consts.TestSymbolReturnsEmpty, null, null);

            Assert.IsTrue(prices.Count == 0);
        }
コード例 #3
0
 public void historical_valid_symbols_throws_not_found()
 {
     Assert.ThrowsException <System.Net.Http.HttpRequestException>(() =>
     {
         using var client = new EODHistoricalDataClient(Consts.ApiToken, true);
         var prices       = client.GetHistoricalPrices(Consts.TestSymbolReturnsEmpty, null, null);
     });
 }
コード例 #4
0
        public void historical_valid_symbols_with_to_date_returns_prices()
        {
            using var client = new EODHistoricalDataClient(Consts.ApiToken, true);
            var prices  = client.GetHistoricalPrices(Consts.TestSymbol, null, Consts.EndDate);
            var maxDate = prices.Max(x => x.Date).Date;

            Assert.IsTrue(maxDate == Consts.EndDate);
        }
コード例 #5
0
        public void historical_valid_symbols_with_from_date_returns_prices()
        {
            using var client = new EODHistoricalDataClient(Consts.ApiToken, true);
            var prices  = client.GetHistoricalPrices(Consts.TestSymbol, Consts.StartDate, null);
            var minDate = prices.Min(x => x.Date).Date;

            Assert.IsTrue(minDate == Consts.StartDate);
        }
コード例 #6
0
        public void historical_valid_symbols_with_from_and_to_date_returns_prices()
        {
            EODHistoricalDataClient client = new EODHistoricalDataClient(Consts.ApiToken, true);
            List <HistoricalPrice>  prices = client.GetHistoricalPrices(Consts.TestSymbol, Consts.StartDate, Consts.EndDate);
            DateTime minDate = prices.Min(x => x.Date).Date;
            DateTime maxDate = prices.Max(x => x.Date).Date;

            Assert.IsTrue(minDate == Consts.StartDate);
            Assert.IsTrue(maxDate == Consts.EndDate);
        }
コード例 #7
0
 public void historical_null_symbol_throws_exception()
 {
     using var client = new EODHistoricalDataClient(Consts.ApiToken);
     var prices = client.GetHistoricalPrices(null, null, null);
 }