public async Task GetTimeframe() { var today = DateTime.Now; var yesterday = today.AddDays(-1); var res = await Api.Currency.GetTimeframe("USD", yesterday, today, "EUR"); Assert.AreEqual("USD", res.Currency); Assert.AreEqual("EUR", res.Base); Assert.AreEqual(2, res.Timespan); Assert.AreEqual(2, res.Rates.Count); Spew.Dump(res); }
public async Task GetHistoricalCurrency() { var yesterday = DateTime.Now.AddDays(-1); var res = await Api.Currency.GetHistoricalAsync(yesterday); Assert.AreEqual("USD", res.Base); res = await Api.Currency.GetHistoricalAsync(yesterday, "EUR", new string[] { "EUR", "GBP", "USD" }); Assert.AreEqual("EUR", res.Base); Spew.Dump(res); }
public async Task GetUsage() { try { var usage = await Api.Usage.GetAsync(); Assert.AreNotEqual(0, usage.Requests["geoip"]); Spew.Dump(usage); } catch (ResponseException ex) { Console.WriteLine("ResponseException: " + ex.Message + " - status: " + ex.Status.ToString()); } catch (Exception ex) { Console.WriteLine("Exception: " + ex.Message); } }