Пример #1
0
        public void TestValidBill_AddRemove()
        {
            float amount   = 5.0f;//h
            float expected = 25.0f;
            float actual   = 0;
            var   bill     = new Bill("Jose Maria Antunez", "Argentina", "3815582300");

            bill.Add(amount, "Bike green", RentType.Hour);
            bill.Add(amount, "Bike white", RentType.Hour);
            bill.Remove(2);
            actual = bill.Total;
            Assert.AreEqual(expected, actual, 0.0001);
        }
Пример #2
0
        public void TestValidPromoBill()
        {
            float amount   = 3.0f; //day family weekend
            float expected = 20.0f * 3.0f * 3.0f * (1.0f - 0.3f);
            float actual;
            var   bill = new Bill("Jose Maria Antunez", "Argentina", "3815582300");

            bill.Add(amount, "Bike black", RentType.Day);
            bill.Add(amount, "Bike white", RentType.Day);
            bill.Add(amount, "Bike blue", RentType.Day);
            actual = bill.Total;
            Assert.AreEqual(expected, actual, 0.0001);
        }
Пример #3
0
        public void TestInvalidBill_Argument_1()
        {
            var bill = new Bill("", "Argentina", "3815582300");

            bill.Add(0, "Bike", RentType.Hour);
        }
Пример #4
0
        public void TestInvalidBill_Amount_Zero()
        {
            var bill = new Bill("Jose Maria Antunez", "Argentina", "3815582300");

            bill.Add(0, "Bike", RentType.Hour);
        }
Пример #5
0
        public void TestInvalidBill_Desc()
        {
            var bill = new Bill("Jose Maria Antunez", "Argentina", "3815582300");

            bill.Add(5, "", RentType.Hour);
        }
Пример #6
0
        public void TestInvalidBill_Argument_3()
        {
            var bill = new Bill("Jose Maria Antunez", "Argentina", "");

            bill.Add(0, "Bike", RentType.Hour);
        }
Пример #7
0
        public void TestInvalidBill_Argument_2()
        {
            var bill = new Bill("Jose Maria Antunez", "", "3815582300");

            bill.Add(0, "Bike", RentType.Hour);
        }