コード例 #1
0
ファイル: CurrencyTest.cs プロジェクト: neoffer/ExchangeRate
        public void WhereOrderBy()
        {
            var exchangeRate = new TcmbExchangeRate();

            exchangeRate.Load();
            var currency = exchangeRate.GetCurrencies(w => w.Unit == 1, o => o.CrossOrder, false).FirstOrDefault();

            Assert.Equal("USD", currency.CurrencyCode.ToString());
        }
コード例 #2
0
ファイル: CurrencyTest.cs プロジェクト: neoffer/ExchangeRate
        public void Where()
        {
            var exchangeRate = new TcmbExchangeRate();

            exchangeRate.Load();
            var currency = exchangeRate.GetCurrencies(w => w.CurrencyCode == "USD").FirstOrDefault();

            Assert.Equal("7.5785", currency.ForexBuying.ToString());
        }
コード例 #3
0
ファイル: CurrencyTest.cs プロジェクト: neoffer/ExchangeRate
        public void Load()
        {
            var exchangeRate = new TcmbExchangeRate();

            exchangeRate.Load();
            var currencies = exchangeRate.GetCurrencies();

            Assert.Equal("20", currencies.Count.ToString());
        }
コード例 #4
0
        public void ExportToCsv()
        {
            var exchangeRate = new TcmbExchangeRate();

            exchangeRate.Load();

            var currencies = exchangeRate.GetCurrencies();

            string result = exchangeRate.ExportToCsv(currencies);

            Assert.NotEmpty(result);
        }
コード例 #5
0
        public void ExportToJson()
        {
            var exchangeRate = new TcmbExchangeRate();

            exchangeRate.Load();

            var currencies = exchangeRate.GetCurrencies();

            var    jsonExporter = new JsonExporter();
            string result       = exchangeRate.ExportToCustomFormat(currencies, jsonExporter);

            Assert.NotEmpty(result);
        }