Example #1
0
 public void InstanceOK()
 {
     //create an instance of the class we want to create
     clsAppointments TestAppointments = new clsAppointments();
     //test to see that it exits
     Assert.IsNotNull(TestAppointments);
 }
 public clsAppointmentCollection()
 {
     //var for the index
     Int32 Index = 0;
     //var to store the record count
     Int32 RecordCount = 0;
     //object for the data connection
     clsDataConnection DB = new clsDataConnection();
     //execute the stored procedure
     DB.Execute("sproc_tblAppointment_SelectAll");
     //get the count of records
     RecordCount = DB.Count;
     //while there are records to proccess
     while (Index < RecordCount)
     {
         //create a blank appointment
         clsAppointments AnAppointment = new clsAppointments();
         //    //read in the fields from the current record               
         AnAppointment.AppointmentID = Convert.ToInt32(DB.DataTable.Rows[Index]["AppointmentID"]);
         AnAppointment.AppointmentLocation = Convert.ToString(DB.DataTable.Rows[Index]["AppointmentLocation"]);
         AnAppointment.AppointmentDate = Convert.ToDateTime(DB.DataTable.Rows[Index]["AppointmentDate"]);
         //    //add the record to the private data member
         appointmentList.Add(AnAppointment);
         //    //point at the next record
         Index++;
     }
 }
Example #3
0
 public void AppointmentTime()
 {
     //create an instance of the paymentmethod
     clsAppointments AnAppointment = new clsAppointments();
     //create some test data to assign to the property 
     DateTime TestData = DateTime.Now.Date;
     //assign the data to the property
     AnAppointment.AppointmentTime = TestData;
     Assert.AreEqual(AnAppointment.AppointmentTime, TestData);
 }
Example #4
0
 public void ActivePropertyOK()
 {
     //create and instance of the class we want to create
     clsAppointments AnAppointment = new clsAppointments();
     //create some test data to assign to the property
     Boolean TestData = true;
     AnAppointment.Active = TestData;
     //test to see that the two values are the same
     Assert.AreEqual(AnAppointment.Active, TestData);
 }
Example #5
0
 public void AppointmentID()
 {
     //create an instance of the class we want to create
     clsAppointments AnAppointment = new clsAppointments();
     //Create some test data to assign to the property
     int Number = 1;
     //assign the data to the property
     AnAppointment.AppointmentID = Number;
     //test to see that the two values are the same
     Assert.AreEqual(AnAppointment.AppointmentID, Number);
 }
Example #6
0
        public void AppointmentLocation()
        {
            //create an instance of the class we want to create
            clsAppointments AnAppointment = new clsAppointments();
            //Create some test data to assign to the property
            string AnAppointmentLocation = "Office";
            //assign the data to the property
            AnAppointment.AppointmentLocation = AnAppointmentLocation;
            //test to see that the two values are the same
            Assert.AreEqual(AnAppointment.AppointmentLocation, AnAppointmentLocation);

        }
 public void ThisAppointmentPropertyOK()
 {
     //create an instance of the class that we want to create 
     clsAppointmentCollection AllAppointments = new clsAppointmentCollection();
     //create sometest data to assign to the property
     clsAppointments TestAppointment = new clsAppointments();
     //set the properties of the test object
     TestAppointment.AppointmentID = 1;
     TestAppointment.AppointmentLocation = "Office";
     TestAppointment.AppointmentDate = DateTime.Now;
     TestAppointment.AppointmentTime = DateTime.Now;
     //assign the data to the property
     AllAppointments.ThisAppointment = TestAppointment;
     //test to see that the two values are the same
     Assert.AreEqual(AllAppointments.ThisAppointment, TestAppointment);
 }
 public void AppointmentListAndCountOK()
 {
     //create an instance of the class that we want to create 
     clsAppointmentCollection AllAppointments = new clsAppointmentCollection();
     //create sometest data to assign to the property
     List<clsAppointments> TestList = new List<clsAppointments>();
     //add an itm to the list
     //create the item of test data
     clsAppointments TestItem = new clsAppointments();
     //set the properties
     TestItem.AppointmentID = 1;
     TestItem.AppointmentLocation = "Office";
     TestItem.AppointmentDate = DateTime.Now;
     TestItem.AppointmentTime = DateTime.Now;
     //add the item to the test list
     TestList.Add(TestItem);
     //assign the data to the property
     AllAppointments.AppointmentList = TestList;
     //test to see that the two values are the same
     Assert.AreEqual(AllAppointments.Count, TestList.Count);
 }
Example #9
0
 public void AppointmentIDExtremeMin()
 {
     clsAppointments TestAppointmentID = new clsAppointments();
     Boolean OK = TestAppointmentID.Valid(-2147483647);
     Assert.IsFalse(OK);
 }
Example #10
0
 public void AppointmentIDMinusOne()
 {
     clsAppointments TestAppointmentID = new clsAppointments();
     Boolean OK = TestAppointmentID.Valid(-1);
     Assert.IsFalse(OK);
 }
Example #11
0
 public void AppointmentValidMethodOK()
 {
     //create an instance of the class we want to create
     clsAppointments AnAppointment = new clsAppointments();
     //Boolean variable to store the result of the validation
     Boolean OK = false;
     //create some test data to use with the method
     String AppointmentLocation = "Office";
     //create a variable to store the test date data
     DateTime TestDate;
     //set todays date
     TestDate = DateTime.Now.Date;
     //convert the date to a string variable
     string AppointmentDate = TestDate.ToString();
     //invoke the method
     OK = AnAppointment.Valid(AppointmentLocation, AppointmentDate);
     //test to see if the result is correct
     Assert.IsTrue(OK);
 }
Example #12
0
 public void AppointmentIDMinBoundary()
 {
     clsAppointments TestAppointmentID = new clsAppointments();
     Boolean OK = TestAppointmentID.Valid(1);
     Assert.IsTrue(OK);
 }
Example #13
0
 public void AppointmentLocationFound()
 {
     //create an instance of the class we want to create
     clsAppointments AnAppointment = new clsAppointments();
     //Boolean variable to store the result of the validation
     Boolean Found = false;
     //boolean variable to record if data is OK (assume it is)
     Boolean OK = true;
     //create some test data to use with the method
     Int32 AppointmentID = 1;
     //invoke the mothod
     Found = AnAppointment.Find(AppointmentID);
     //chech the address no
     if (AnAppointment.AppointmentLocation != "Office")
     {
         OK = true;
     }
     //test to see if the result is correct
     Assert.IsTrue(OK);
 }
Example #14
0
 public void TestAppointmentIDFound()
 {
     clsAppointments AnAppointment = new clsAppointments();
     Boolean Found = false;
     Boolean OK = true;
     Int32 AppointmentID = 2;
     Found = AnAppointment.Find(AppointmentID);
     if (AnAppointment.AppointmentID != 2)
     {
         OK = true;
     }
     Assert.IsTrue(OK);
 }
Example #15
0
 public void AppointmentIDMaxBoundary()
 {
     clsAppointments TestAppointmentID = new clsAppointments();
     Boolean OK = TestAppointmentID.Valid(2147483647);
     Assert.IsTrue(OK);
 }
Example #16
0
 public void AppointmentLocationInvalidDataType()
 {
     clsAppointments TestAppointmentLocation = new clsAppointments();
     Boolean OK = TestAppointmentLocation.ValidString(null);
     Assert.IsFalse(OK);
 }
Example #17
0
 public void AppointmentIDPropertyOK()
 {
     clsAppointments AnAppointment = new clsAppointments();
     Int32 TestData = 1;
     AnAppointment.AppointmentID = TestData;
     Assert.AreEqual(AnAppointment.AppointmentID, TestData);
 }
Example #18
0
 public void AppointmentIDMinPlusOne()
 {
     clsAppointments TestAppointmentID = new clsAppointments();
     Boolean OK = TestAppointmentID.Valid(2);
     Assert.IsTrue(OK);
 }
Example #19
0
 public void AppointmentLocationMinBoundary()
 {
     clsAppointments TestAppointmentLocation = new clsAppointments();
     Boolean OK = TestAppointmentLocation.ValidString("L");
     Assert.IsTrue(OK);
 }
Example #20
0
 public void AppointmentIDMid()
 {
     clsAppointments TestAppointmentID = new clsAppointments();
     Boolean OK = TestAppointmentID.Valid(1013741824);
     Assert.IsTrue(OK);
 }
Example #21
0
 public void AppointmentsLocationOK()
 {
     clsAppointments TestAppointments = new clsAppointments();
     string TestData = "Loughborough";
     TestAppointments.AppointmentLocation = TestData;
     Assert.AreEqual(TestAppointments.AppointmentLocation, TestData);
 }
Example #22
0
 public void FindMethodOK()
 {
     //create an instance of the paymentmethod
     clsAppointments AnAppointment = new clsAppointments();
     //boolean variable to store the result of the validation
     Boolean Found = false;
     //create some test data to use with the method
     Int32 AppointmentID = 2;
     //invoke the method
     Found = AnAppointment.Find(AppointmentID);
     //test to see that the result is correct
     Assert.IsFalse(Found);
 }                        
Example #23
0
 public void AppointmentLocationMid()
 {
     clsAppointments TestAppointmentLocation = new clsAppointments();
     Boolean OK = TestAppointmentLocation.ValidString("LoughboroughLo");
     Assert.IsTrue(OK);
 }
Example #24
0
 public void AppointmentIDMaxMinusOne()
 {
     clsAppointments TestAppointmentID = new clsAppointments();
     Boolean OK = TestAppointmentID.Valid(2147483646);
     Assert.IsTrue(OK);
 }
Example #25
0
 public void AppointmentDateMax()
 {
     //create an instance of the paymentmethod
     clsAppointments AnAppointment = new clsAppointments();
     //boolean variable to store the result of the validation
     Boolean OK = false;
     //create some test data to pass to the method
     string AppointmentLocation = "Loughborough";
     //create a variable to store the test date data
     DateTime TestDate;
     //set todays date
     TestDate = DateTime.Now.Date;
     //change the date to whatever the date is less 100 years
     TestDate = TestDate.AddYears(100);
     //convert the date to a string variable
     string AppointmentDate = TestDate.ToString();
     //invoke the method
     OK = AnAppointment.Valid(AppointmentLocation, AppointmentDate);
     //test to see that result is correct
     Assert.IsTrue(OK);
 }
Example #26
0
            public void AppointmentDatePropertyOK()
            {
                //create and instance of the class we want to create
                clsAppointments AnAppointment = new clsAppointments();
                //create some teest data to assign to the property
                DateTime TestData = DateTime.Now.Date;
                //Assign the Data to the property
                AnAppointment.AppointmentDate = TestData;
                //test to see that the two values are the same
                Assert.AreEqual(AnAppointment.AppointmentDate, TestData);

            }