public void CheckOutDateMaxLessOne() { //creat an instance of clsBooking class clsBooking aBooking = new clsBooking(); //boolean var to store the result of the validation Boolean Ok = false; //var to store NumOfNights string NumOfNights = "15"; //create a var to store test data DateTime TestDate; //asign some data to testdata TestDate = DateTime.Now.Date.AddDays(29); //var to store BookingDate string BookigDate = DateTime.Now.Date.ToString(); //var to store checkInDate string CheckInDate = DateTime.Now.Date.ToString(); //var to store CheckOutDate string CheckOutDate = TestDate.ToString(); //invoke the method Ok = aBooking.Valid(NumOfNights, BookigDate, CheckInDate, CheckOutDate); //test to see that the result is correct Assert.IsTrue(Ok); }
public void NumOfNightsExtreamMax() { //creat an instance of clsBooking class clsBooking aBooking = new clsBooking(); //boolean var to store the result of the validation Boolean Ok = false; //var to store NumOfNights string NumOfNights; //asign some data to var NumOfNights = "1000"; //var to store BookingDate string BookigDate = DateTime.Now.Date.ToString(); //var to store checkInDate string CheckInDate = DateTime.Now.Date.ToString(); //var to store CheckOutDate string CheckOutDate = DateTime.Now.Date.ToString(); //invoke the method Ok = aBooking.Valid(NumOfNights, BookigDate, CheckInDate, CheckOutDate); //test to see that the result is correct Assert.IsFalse(Ok); }
public void ValidateMethodOk() { //creat an instance of clsBooking class clsBooking aBooking = new clsBooking(); //boolean var to store the result of the validation Boolean Found = false; //var to store NumOfNights string NumOfNights; //asign some data to var NumOfNights = "1"; //var to store BookingDate string BookigDate = DateTime.Now.Date.ToString(); //var to store checkInDate string CheckInDate = DateTime.Now.Date.ToString(); //var to store CheckOutDate string CheckOutDate = DateTime.Now.Date.ToString(); //invoke the method Found = aBooking.Valid(NumOfNights, BookigDate, CheckInDate, CheckOutDate); //test to see that two values are same Assert.IsTrue(Found); }