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++; } }
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); }
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); }
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); }
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); }
public void AppointmentIDExtremeMin() { clsAppointments TestAppointmentID = new clsAppointments(); Boolean OK = TestAppointmentID.Valid(-2147483647); Assert.IsFalse(OK); }
public void AppointmentIDMinusOne() { clsAppointments TestAppointmentID = new clsAppointments(); Boolean OK = TestAppointmentID.Valid(-1); Assert.IsFalse(OK); }
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); }
public void AppointmentIDMinBoundary() { clsAppointments TestAppointmentID = new clsAppointments(); Boolean OK = TestAppointmentID.Valid(1); Assert.IsTrue(OK); }
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); }
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); }
public void AppointmentIDMaxBoundary() { clsAppointments TestAppointmentID = new clsAppointments(); Boolean OK = TestAppointmentID.Valid(2147483647); Assert.IsTrue(OK); }
public void AppointmentLocationInvalidDataType() { clsAppointments TestAppointmentLocation = new clsAppointments(); Boolean OK = TestAppointmentLocation.ValidString(null); Assert.IsFalse(OK); }
public void AppointmentIDPropertyOK() { clsAppointments AnAppointment = new clsAppointments(); Int32 TestData = 1; AnAppointment.AppointmentID = TestData; Assert.AreEqual(AnAppointment.AppointmentID, TestData); }
public void AppointmentIDMinPlusOne() { clsAppointments TestAppointmentID = new clsAppointments(); Boolean OK = TestAppointmentID.Valid(2); Assert.IsTrue(OK); }
public void AppointmentLocationMinBoundary() { clsAppointments TestAppointmentLocation = new clsAppointments(); Boolean OK = TestAppointmentLocation.ValidString("L"); Assert.IsTrue(OK); }
public void AppointmentIDMid() { clsAppointments TestAppointmentID = new clsAppointments(); Boolean OK = TestAppointmentID.Valid(1013741824); Assert.IsTrue(OK); }
public void AppointmentsLocationOK() { clsAppointments TestAppointments = new clsAppointments(); string TestData = "Loughborough"; TestAppointments.AppointmentLocation = TestData; Assert.AreEqual(TestAppointments.AppointmentLocation, TestData); }
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); }
public void AppointmentLocationMid() { clsAppointments TestAppointmentLocation = new clsAppointments(); Boolean OK = TestAppointmentLocation.ValidString("LoughboroughLo"); Assert.IsTrue(OK); }
public void AppointmentIDMaxMinusOne() { clsAppointments TestAppointmentID = new clsAppointments(); Boolean OK = TestAppointmentID.Valid(2147483646); Assert.IsTrue(OK); }
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); }
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); }