Esempio n. 1
0
        public void HappyTestCheckDateMethodByPassingTwoDatesAndGettingTrueIfCorrect()
        {
            DateTime startDate = Convert.ToDateTime("09/11/2020");
            DateTime endDate   = Convert.ToDateTime("09/12/2020");
            bool     flag      = ManageHotels.CheckDate(startDate, endDate);

            Assert.IsTrue(flag);
        }
Esempio n. 2
0
        public void SadTestCheckDateMethodByPassingTwoDatesAndGettingTrueIfCorrect()
        {
            DateTime endDate   = Convert.ToDateTime("09/11/2020");
            DateTime startDate = Convert.ToDateTime("09/12/2020");
            //bool flag = ManageHotels.CheckDate(startDate, endDate);
            var exception = Assert.ThrowsException <HRSCustomException>(
                () => ManageHotels.CheckDate(startDate, endDate), "Date range is wrong");

            Assert.AreEqual("Date range is wrong", exception.Message);
        }