Ejemplo n.º 1
0
        public void TestBuildPreludePairingsUrl()
        {
            PreludeMarketId marketId = new PreludeMarketId("DOGE", PreludeQuoteCurrency.USD);
            string          url      = PreludeExchange.BuildPublicUrl(PreludeExchange.Method.pairings, marketId.QuoteCurrencyCode);

            Assert.AreEqual("https://api.prelude.io/pairings/usd", url);
        }
Ejemplo n.º 2
0
        public void TestParsePreludeMarketPairs()
        {
            JObject         marketsJson = LoadTestData <JObject>("pairings.json");
            List <MarketId> markets     = PreludeMarketId.ParsePairs(marketsJson, PreludeQuoteCurrency.BTC);

            Assert.AreEqual(15, markets.Count);

            Assert.AreEqual("AUR_BTC", markets[0].ToString());
            Assert.AreEqual("DRK_BTC", markets[1].ToString());
            Assert.AreEqual("DGB_BTC", markets[2].ToString());
            Assert.AreEqual("DGC_BTC", markets[3].ToString());
            Assert.AreEqual("DOGE_BTC", markets[4].ToString());
        }
Ejemplo n.º 3
0
        public void TestParsePreludeMarketTrades()
        {
            JObject            tradesJson = LoadTestData <JObject>("last.json");
            PreludeMarketId    marketId   = new PreludeMarketId("DOGE", PreludeQuoteCurrency.BTC);
            List <MarketTrade> trades     = PreludeMarketTrade.Parse(marketId, tradesJson);

            Assert.AreEqual(25, trades.Count);
            Assert.AreEqual(new DateTime(2014, 4, 4, 19, 48, 34), trades[0].DateTime);
            Assert.AreEqual(1000m, trades[0].Quantity);
            Assert.AreEqual(0.00000103m, trades[0].Price);

            Assert.AreEqual(new DateTime(2014, 4, 4, 19, 21, 29), trades[1].DateTime);
            Assert.AreEqual(42326.92307692m, trades[1].Quantity);
            Assert.AreEqual(0.00000104m, trades[1].Price);
        }