Esempio n. 1
0
        public void Test_Ticket()
        {
            BankCard  card      = rd.GetMoneyData(path_2, 1);
            decimal   tmp_1     = card.GetMoney();
            Ticket    ticket    = new Ticket();
            Transport transport = new Transport();
            int       daysCount = 4;
            decimal   price     = daysCount * 10;

            transport.MakeTransport(price, daysCount, ETickets.Transport, card);
            decimal tmp_2 = card.GetMoney();

            Assert.AreEqual(tmp_1 - 40, tmp_2);
        }
Esempio n. 2
0
        public void Test_BankCard()
        {
            BankCard card = rd.GetMoneyData(path_2, 1);

            Assert.AreEqual(640, card.GetMoney());

            card.AddMoney(123.456m);
            Assert.AreEqual(763.456m, card.GetMoney());

            decimal tmp_1 = card.GetMoney();

            card.WithdrawMoney(700);
            decimal tmp_2 = card.GetMoney();

            Assert.AreNotEqual(tmp_1, tmp_2);

            card.validDate = Convert.ToDateTime("01.01.1999");
            Assert.AreEqual(false, card.IsWork());
        }