Exemplo n.º 1
0
        public void QAVDTest(QAVTest test)
        {
            Avq.UrlContenResult = File.ReadAllText(AvTimeSeriesDailyJsonTestFile);
            object actual = Avq.QAVD(test.Symbol, info: test.Info, tradingDay: test.DatePart, tradingDate: test.QuoteDate);

            Assert.Equal(test.Expected, actual);
        }
Exemplo n.º 2
0
        public void QAVDWebNegativeTest(QAVTest test)
        {
            Avq.UrlContenResult = FfeWeb.GetHttpResponseContent($"https://www.alphavantage.co/query?function=TIME_SERIES_DAILY&symbol={test.Symbol}&apikey={test.ApiKey}");

            if (test.OutputSize.Equals("n/a"))
            {
                Assert.Throws <ArgumentException>(() => Avq.QAVD(test.Symbol, info: test.Info, tradingDay: test.DatePart, tradingDate: test.QuoteDate, bestMatch: test.BestMatch, outputSize: test.OutputSize));
            }
            else
            {
                object actual = Avq.QAVD(test.Symbol, info: test.Info, tradingDay: test.DatePart, tradingDate: test.QuoteDate, bestMatch: test.BestMatch, outputSize: test.OutputSize);
                Assert.Equal(test.Expected, actual);
            }
        }
Exemplo n.º 3
0
        public void QAVDWebTest(QAVTest test)
        {
            if (test.OutputSize.Equals("full"))
            {
                Avq.UrlContenResult = FfeWeb.GetHttpResponseContent($"https://www.alphavantage.co/query?function=TIME_SERIES_DAILY&symbol={test.Symbol}&outputsize={test.OutputSize}&apikey={test.ApiKey}");
            }
            else
            {
                Avq.UrlContenResult = FfeWeb.GetHttpResponseContent($"https://www.alphavantage.co/query?function=TIME_SERIES_DAILY&symbol={test.Symbol}&apikey={test.ApiKey}");
            }
            object actual = Avq.QAVD(test.Symbol, info: test.Info, tradingDay: test.DatePart, tradingDate: test.QuoteDate, bestMatch: test.BestMatch, outputSize: test.OutputSize);

            QAVAssert(test, actual);
        }