示例#1
0
        public void TestReadTransportersTimeInvalid2()
        {
            BestTransporterView btr     = new BestTransporterView();
            Tuple <int, string> tupTime = btr.ValidateTime("15:60");

            Assert.IsTrue(tupTime.Item1 == -1, "Time entered is invalid");
            Assert.IsTrue(tupTime.Item2.Length > 0, "should be error msg");
        }
示例#2
0
        public void TestReadTransportersTimeWithNoLeadingZero()
        {
            BestTransporterView btr     = new BestTransporterView();
            Tuple <int, string> tupTime = btr.ValidateTime("9:00");

            Assert.IsTrue(tupTime.Item1 == 540, "Time entered should be 9*60 = 540 mins = 9am");
            Assert.IsTrue(tupTime.Item2.Length == 0, "should be no error with zero length error msg");
        }
示例#3
0
        public void TestReadTransportersTime3()
        {
            BestTransporterView btr     = new BestTransporterView();
            Tuple <int, string> tupTime = btr.ValidateTime("00:00");

            Assert.IsTrue(tupTime.Item1 == 0, "Time entered should be 12 midnight or the start of a new day");
            Assert.IsTrue(tupTime.Item2.Length == 0, "should be no error with zero length error msg");
        }
示例#4
0
        public void TestReadTransportersTime4()
        {
            BestTransporterView btr     = new BestTransporterView();
            Tuple <int, string> tupTime = btr.ValidateTime("23:59");

            Assert.IsTrue(tupTime.Item1 == 1439, "Time entered should be 23*60 + 59 = 1439 mins = 23:59 or 11:59pm");
            Assert.IsTrue(tupTime.Item2.Length == 0, "should be no error with zero length error msg");
        }
示例#5
0
        public void TestReadTransportersTime2()
        {
            BestTransporterView btr     = new BestTransporterView();
            Tuple <int, string> tupTime = btr.ValidateTime("09:12");

            Assert.IsTrue(tupTime.Item1 == 552, "Time entered should be 9*60 + 12 = 552 mins = 9:12am");
            Assert.IsTrue(tupTime.Item2.Length == 0, "should be no error with zero length error msg");
        }