Ejemplo n.º 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);
 }
Ejemplo n.º 2
0
 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++;
     }
 }
Ejemplo n.º 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);
 }
Ejemplo n.º 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);
 }
Ejemplo n.º 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);
 }
Ejemplo n.º 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);

        }
Ejemplo n.º 7
0
 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);
 }
Ejemplo n.º 8
0
 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);
 }
Ejemplo n.º 9
0
 public void AppointmentIDExtremeMin()
 {
     clsAppointments TestAppointmentID = new clsAppointments();
     Boolean OK = TestAppointmentID.Valid(-2147483647);
     Assert.IsFalse(OK);
 }
Ejemplo n.º 10
0
 public void AppointmentIDMinusOne()
 {
     clsAppointments TestAppointmentID = new clsAppointments();
     Boolean OK = TestAppointmentID.Valid(-1);
     Assert.IsFalse(OK);
 }
Ejemplo n.º 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);
 }
Ejemplo n.º 12
0
 public void AppointmentIDMinBoundary()
 {
     clsAppointments TestAppointmentID = new clsAppointments();
     Boolean OK = TestAppointmentID.Valid(1);
     Assert.IsTrue(OK);
 }
Ejemplo n.º 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);
 }
Ejemplo n.º 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);
 }
Ejemplo n.º 15
0
 public void AppointmentIDMaxBoundary()
 {
     clsAppointments TestAppointmentID = new clsAppointments();
     Boolean OK = TestAppointmentID.Valid(2147483647);
     Assert.IsTrue(OK);
 }
Ejemplo n.º 16
0
 public void AppointmentLocationInvalidDataType()
 {
     clsAppointments TestAppointmentLocation = new clsAppointments();
     Boolean OK = TestAppointmentLocation.ValidString(null);
     Assert.IsFalse(OK);
 }
Ejemplo n.º 17
0
 public void AppointmentIDPropertyOK()
 {
     clsAppointments AnAppointment = new clsAppointments();
     Int32 TestData = 1;
     AnAppointment.AppointmentID = TestData;
     Assert.AreEqual(AnAppointment.AppointmentID, TestData);
 }
Ejemplo n.º 18
0
 public void AppointmentIDMinPlusOne()
 {
     clsAppointments TestAppointmentID = new clsAppointments();
     Boolean OK = TestAppointmentID.Valid(2);
     Assert.IsTrue(OK);
 }
Ejemplo n.º 19
0
 public void AppointmentLocationMinBoundary()
 {
     clsAppointments TestAppointmentLocation = new clsAppointments();
     Boolean OK = TestAppointmentLocation.ValidString("L");
     Assert.IsTrue(OK);
 }
Ejemplo n.º 20
0
 public void AppointmentIDMid()
 {
     clsAppointments TestAppointmentID = new clsAppointments();
     Boolean OK = TestAppointmentID.Valid(1013741824);
     Assert.IsTrue(OK);
 }
Ejemplo n.º 21
0
 public void AppointmentsLocationOK()
 {
     clsAppointments TestAppointments = new clsAppointments();
     string TestData = "Loughborough";
     TestAppointments.AppointmentLocation = TestData;
     Assert.AreEqual(TestAppointments.AppointmentLocation, TestData);
 }
Ejemplo n.º 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);
 }                        
Ejemplo n.º 23
0
 public void AppointmentLocationMid()
 {
     clsAppointments TestAppointmentLocation = new clsAppointments();
     Boolean OK = TestAppointmentLocation.ValidString("LoughboroughLo");
     Assert.IsTrue(OK);
 }
Ejemplo n.º 24
0
 public void AppointmentIDMaxMinusOne()
 {
     clsAppointments TestAppointmentID = new clsAppointments();
     Boolean OK = TestAppointmentID.Valid(2147483646);
     Assert.IsTrue(OK);
 }
Ejemplo n.º 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);
 }
Ejemplo n.º 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);

            }