public void DestinationNameMinPlusOne() { // create an instance of the class we want to create clsDestination ADestination = new clsDestination(); // boolean variable to store the result of the validation Boolean OK = false; // create test data to assign to the property string Destination = "DA"; decimal Price = 100; string Flight = Convert.ToString(DateTime.Now.Date); string Return = Convert.ToString(DateTime.Now.Date.AddDays(1)); // execute the method OK = ADestination.Valid(Destination, Price, Flight, Return); // test to see that the result is correct Assert.IsTrue(OK); }
public void PickupMin() { //create an instance of the class we want to create clsDestination AnDestination = new clsDestination(); //string variable to store any error message String Error = ""; //create a variable to store the test date data DateTime TestDate; //set the date totodays date TestDate = DateTime.Now.Date; //convert the date variable to a string variable string PickupTime = TestDate.ToString(); //invoke the method Error = AnDestination.Valid(EndPointHouseNo, EndPointPostCode, EndPointStreet, EndPointTown, PickupTime); //test to see that the result is correct Assert.AreEqual(Error, ""); }
public void PickupTimeInvalidData() { //create an instance of the class we want to create clsDestination AnDestination = new clsDestination(); //string variable to store any error message String Error = ""; //create some test data to pass to the method string EndPointHouseNo = "43"; string EndPointPostCode = "LE2 2BT"; string EndPointStreet = "Carterhatch Street"; string EndPointTown = "Leicester"; string DropoffTime = DateTime.Now.Date.ToString(); //set the DropoffTime to a non data value string PickupTime = "This Is Not A Date!"; //invoke the method Error = AnDestination.Valid(EndPointHouseNo, EndPointPostCode, EndPointStreet, EndPointTown, PickupTime); //test to see that the result is correct Assert.AreNotEqual(Error, ""); }