Exemplo n.º 1
0
 public void CompanyNameMaxLessOneOk()
 {
     //create an instance of the class we want to create
      clsEvent AEvent = new clsEvent();
      //boolean variable to store the result of the validation
      Boolean OK = false;
      //create some test data to pass to the method
      string EventName = "Women in Technology";
      string CompanyName = "";
      string Contact = "075432345";
      string StartDate = DateTime.Now.Date.ToString();
      string GuestSpeaker = "Elizabeth Saw";
      string TypeOfEvent = "Conference";
      string ConsultantAttending = "Egle Sciglinskaite";
      string Location = "Excel London";
      CompanyName = CompanyName.PadRight(29, 'b');
      //invoke method
      OK = AEvent.Valid(EventName, CompanyName, Contact, StartDate, GuestSpeaker, Location, TypeOfEvent, ConsultantAttending);
      //check if it is correct
      Assert.IsTrue(OK);
 }
Exemplo n.º 2
0
        public void GuestSpeakerMaxPlusOneOk()
        {
            //create an instance of the class we want to create
             clsEvent AEvent = new clsEvent();
             //boolean variable to store the result of the validation
             Boolean OK = false;
             //create some test data to pass to the method
             string EventName = "Women in Technology";
             string CompanyName = "CTech";
             string Contact = "075432345";
             string StartDate = DateTime.Now.Date.ToString();
             string GuestSpeaker = "";
             string TypeOfEvent = "Conference";
             string ConsultantAttending = "Egle Sciglinskaite";
             //variable to store location
             string Location = "Excel London";
             //creates  29 characters instead of writing many out
            GuestSpeaker = GuestSpeaker.PadRight(31, 'b');
             //variable to store date

             //invoke method
             OK = AEvent.Valid(EventName, CompanyName, Contact, StartDate, GuestSpeaker, Location, TypeOfEvent, ConsultantAttending);
             //check iff it is correct
             Assert.IsFalse(OK);
        }
Exemplo n.º 3
0
 public void StartDateMinPlusOneOK()
 {
     //create an instance of the class we want to create
      clsEvent AEvent = new clsEvent();
      //boolean variable to store the result of the validation
      Boolean OK = false;
      //create some test data to pass to the method
      string EventName = "Women in Technolog";
      string CompanyName = "CTech";
      string Contact = "075432345";
      string GuestSpeaker = "Elizabeth Saw";
      string Location = "Excel London";
      string TypeOfEvent = "Conference";
      string ConsultantAttending = "Egle Sciglinskaite";
      //variable to store date
      DateTime TestDate;
      //set to todays date
      TestDate = DateTime.Now.Date;
      //date changed to 1, this test should fail
      TestDate = TestDate.AddDays(1);
      //convert date variable to string variable
      string StartDate = TestDate.ToString();
      //invoke method
      OK = AEvent.Valid(EventName, CompanyName, Contact, StartDate, GuestSpeaker, Location, TypeOfEvent, ConsultantAttending);
      //check iff it is correct
      Assert.IsFalse(OK);
 }
Exemplo n.º 4
0
 public void StartDateInvalidDataOK()
 {
     //create an instance of the class we want to create
      clsEvent AEvent = new clsEvent();
      //boolean variable to store the result of the validation
      Boolean OK = false;
      //create some test data to pass to the method
      string EventName = "Women in Technolog";
      string CompanyName = "CTech";
      string Contact = "075432345";
      string GuestSpeaker = "Elizabeth Saw";
      string Location = "Excel London";
      string TypeOfEvent = "Conference";
      //variable to store date
      string StartDate = "January twentieth";
      string ConsultantAttending = "Egle Sciglinskaite";
      //invoke method
      OK = AEvent.Valid(EventName, CompanyName, Contact, StartDate, GuestSpeaker, Location, TypeOfEvent, ConsultantAttending);
      //check iff it is correct
      Assert.IsFalse(OK);
 }