Exemplo n.º 1
0
        public void OneQuoteTest()
        {
            var q = new Quote
            {
                Symbol = "EURUSD",
                Price  = 1.0m
            };
            var store = new QuoteStore();

            store.PushQuote(q);

            var market = store.GetCurrentMarket();

            Assert.AreEqual(1, market.Count);
            Assert.AreEqual("EURUSD", market[0].Symbol);
            Assert.AreEqual(1.0, market[0].Price);
        }
Exemplo n.º 2
0
        public void SomeQuotesTest()
        {
            var q1 = new Quote
            {
                Symbol = "EURUSD",
                Price  = 1.0m
            };
            var q2 = new Quote
            {
                Symbol = "USDJPY",
                Price  = 2.0m
            };
            var store = new QuoteStore();

            store.PushQuote(q1);
            store.PushQuote(q2);

            var market = store.GetCurrentMarket();

            Assert.AreEqual(2, market.Count);
            Assert.IsTrue(market.Any(quote => quote.Symbol == "EURUSD" && quote.Price == 1.0m));
            Assert.IsTrue(market.Any(quote => quote.Symbol == "USDJPY" && quote.Price == 2.0m));
        }
Exemplo n.º 3
0
        public void QuoteReplaceTest()
        {
            var q = new Quote
            {
                Symbol = "EURUSD",
                Price = 1.0m
            };
            var store = new QuoteStore();
            store.PushQuote(q);
            q.Price = 2.0m;
            store.PushQuote(q);

            var market = store.GetCurrentMarket();
            Assert.AreEqual(1, market.Count);
            Assert.AreEqual("EURUSD", market[0].Symbol);
            Assert.AreEqual(2.0, market[0].Price);
        }
Exemplo n.º 4
0
        public void SomeQuotesTest()
        {
            var q1 = new Quote
            {
                Symbol = "EURUSD",
                Price = 1.0m
            };
            var q2 = new Quote
            {
                Symbol = "USDJPY",
                Price = 2.0m
            };
            var store = new QuoteStore();
            store.PushQuote(q1);
            store.PushQuote(q2);

            var market = store.GetCurrentMarket();
            Assert.AreEqual(2, market.Count);
            Assert.IsTrue(market.Any(quote => quote.Symbol == "EURUSD" && quote.Price == 1.0m));
            Assert.IsTrue(market.Any(quote => quote.Symbol == "USDJPY" && quote.Price == 2.0m));
        }