Exemplo n.º 1
0
        public void buyOrSellPS_buy_D_Test()// тест покупки бумаги D
        {
            //arrange
            String[] vals     = { "C2", "1000", "1", "1", "1", "1" };
            String   reqType  = "b";
            String   psType   = "D";
            int      cost     = 1;
            int      qt       = 1;
            String   expected = "C2\t999\t1\t1\t1\t2";

            //act
            MatchingReqClassLibrary.Trader test = new MatchingReqClassLibrary.Trader(vals);
            test.buyOrSellPS(reqType, psType, cost, qt);
            String actual = test.getTraderData();

            //assert
            Assert.AreEqual(expected, actual);
        }
Exemplo n.º 2
0
        public void buyOrSellPS_sell_C_Test()// тест продажи бумаги C
        {
            //arrange
            String[] vals     = { "C2", "1000", "1", "1", "1", "1" };
            String   reqType  = "s";
            String   psType   = "C";
            int      cost     = 1;
            int      qt       = 1;
            String   expected = "C2\t1001\t1\t1\t0\t1";

            //act
            MatchingReqClassLibrary.Trader test = new MatchingReqClassLibrary.Trader(vals);
            test.buyOrSellPS(reqType, psType, cost, qt);
            String actual = test.getTraderData();

            //assert
            Assert.AreEqual(expected, actual);
        }