private void PrintLeave(int studentID) { try { clsManager manager = new clsManager(); ReportViewer1.Visible = true; ReportDataSource rds = new ReportDataSource(); ReportViewer1.Reset(); ReportViewer1.ProcessingMode = ProcessingMode.Local; LocalReport rep = ReportViewer1.LocalReport; rep.Refresh(); rds.Name = "Student"; rep.ReportPath = "Reports/rptStudentInfo.rdlc"; rds.Value = manager.RetrunDataset("select *from tblStudent where StudentId =" + studentID + " ").Tables[0]; ReportParameter[] p = { new ReportParameter("Company", "Square") }; rep.SetParameters(p); //This name must be in "<datasetname>_<datatablename>" format. This name can also be seen in dataset's datasource view. rep.DataSources.Add(rds); } catch { } }
public void InstanceOk() { //create an instance of the class we want to create clsManager AManager = new clsManager(); //test to see that it exists Assert.IsNotNull(AManager); }
public void TelephoneNumberOk() { //create an instance of the class we want to create clsManager AManager = new clsManager(); //create some test data to assign to the property String TelephoneNumber = "01112234567"; //assign the data to the property AManager.TelephoneNumber = TelephoneNumber; //test to see that the two values are the same Assert.AreEqual(AManager.TelephoneNumber, TelephoneNumber); }
public void SurnameOk() { //create an instance of the class we want to create clsManager AManager = new clsManager(); //create some test data to assign to the property String Surname = "Kardashian"; //assign the data to the property AManager.Surname = Surname; //test to see that the two values are the same Assert.AreEqual(AManager.Surname, Surname); }
public void FirstnameOk() { //create an instance of the class we want to create clsManager AManager = new clsManager(); //create some test data to assign to the property String Firstname = "Kourtney"; //assign the data to the property AManager.Firstname = Firstname; //test to see that the two values are the same Assert.AreEqual(AManager.Firstname, Firstname); }
public void EmailAddressOk() { //create an instance of the class we want to create clsManager AManager = new clsManager(); //create some test data to assign to the property String EmailAddress = "*****@*****.**"; //assign the data to the property AManager.EmailAddress = EmailAddress; //test to see that the two values are the same Assert.AreEqual(AManager.EmailAddress, EmailAddress); }
public void ManagerIDOk() { //create an instance of the class we want to create clsManager AManager = new clsManager(); //create some test data to assign to the property Int32 ManagerID = 1; //assign the data to the property AManager.ManagerID = ManagerID; //test to see that the two values are the same Assert.AreEqual(AManager.ManagerID, ManagerID); }
public void AddressOk() { //create an instance of the class we want to create clsManager AManager = new clsManager(); //create some test data to assign to the property String Address = "11"; //assign the data to the property AManager.Address = Address; //test to see that the two values are the same Assert.AreEqual(AManager.Address, Address); }
public void FindMethodOk() { //create an instance of the class we want to create clsManager AManager = new clsManager(); //boolen variable to store the result of the validation Boolean Found = false; //create some test data to use with the method Int32 ManagerID = 22; //invoke the method Found = AManager.Find(ManagerID); //test to see that the result is correct Assert.IsTrue(Found); }
public void TelephoneNumberMid() { //create an instance of the class we want to create clsManager AManager = new clsManager(); //create a string variable to store the result of the validation string Error = ""; //create some test data to test the method string Address = "14 Mayfair Street"; string EmailAddress = "*****@*****.**"; string Firstname = "Kam"; string Surname = "Kaur"; string Password = "******"; string TelephoneNumber = "01234"; //this should be ok //invoke the method Error = AManager.Valid(Address, EmailAddress, Firstname, Surname, Password, TelephoneNumber); //test to see that the result is correct Assert.AreEqual(Error, ""); }
public void AddressMaxPlusOne() { //create an instance of the class we want to create clsManager AManager = new clsManager(); //create a string variable to store the result of the validation string Error = ""; //create some test data to test the method string Address = "mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm"; //this should trigger an error string EmailAddress = "*****@*****.**"; string Firstname = "Kam"; string Surname = "Kaur"; string Password = "******"; string TelephoneNumber = "01169877896"; //invoke the method Error = AManager.Valid(Address, EmailAddress, Firstname, Surname, Password, TelephoneNumber); //test to see that the result is correct Assert.AreNotEqual(Error, ""); }
public void TestManagerIDFound() { //create an instance of the class we want to create clsManager AManager = new clsManager(); //boolean variable to store the result of the search 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 ManagerID = 22; //invoke the method Found = AManager.Find(ManagerID); //check the manager id if (AManager.ManagerID != 22) { OK = false; } //test to see that the result is correct Assert.IsTrue(OK); }
public void EmailAddressExtremeMax() { //create an instance of the class we want to create clsManager AManager = new clsManager(); //create a string variable to store the result of the validation string Error = ""; //create some test data to test the method string Address = "14 Mayfair Street"; string EmailAddress = ""; EmailAddress = EmailAddress.PadRight(500, 'k'); //this should fail string Firstname = "Kam"; string Surname = "Kaur"; string Password = "******"; string TelephoneNumber = "01169877896"; //invoke the method Error = AManager.Valid(Address, EmailAddress, Firstname, Surname, Password, TelephoneNumber); //test to see that the result is correct Assert.AreNotEqual(Error, ""); }