public void ListAndCountOk() { //create an instance of the class we want to create clsCustomerCollection ACustomer = new clsCustomerCollection(); //create some test data to assign to the tests List <clsCustomerDetails> TestList = new List <clsCustomerDetails>(); //add an item to the list //create the item of test data clsCustomerDetails TestItem = new clsCustomerDetails(); //set its properties TestItem.customerid = 5; TestItem.username = "******"; TestItem.password = "******"; TestItem.firstname = "Jonathan"; TestItem.lastname = "Smith"; TestItem.emailaddress = "*****@*****.**"; TestItem.mobilenumber = "07701343822"; TestItem.cardnumber = "0236562385697459"; TestItem.secruitycode = "454"; TestItem.expirydate = DateTime.Now.Date; TestItem.addressName = "44A"; TestItem.streetname = "Newarke Close"; TestItem.cityname = "Leicester"; TestItem.postcode = "LE2 7GZ"; //add the items to the test list TestList.Add(TestItem); //assign the data to the property ACustomer.mCustomerList = TestList; //test to see if the valid method works Assert.AreEqual(ACustomer.mCustomerList.Count, TestList.Count); }
public void AddMethodOk() { //create an instance of the class we want to create clsCustomerCollection ACustomer = new clsCustomerCollection(); //create the item of test data clsCustomerDetails TestItem = new clsCustomerDetails(); //var to store the primary key Int32 PrimaryKey = 0; //set its properties TestItem.customerid = 5; TestItem.username = "******"; TestItem.password = "******"; TestItem.firstname = "Upesh"; TestItem.lastname = "Chavda"; TestItem.emailaddress = "*****@*****.**"; TestItem.mobilenumber = "07754885553"; TestItem.cardnumber = "02365153439"; TestItem.secruitycode = "454"; TestItem.expirydate = DateTime.Now.Date; TestItem.addressName = "44A"; TestItem.streetname = "Newarke Close"; TestItem.cityname = "Leicester"; TestItem.postcode = "LE2 7GZ"; //set this ThisCustomer to the test data ACustomer.ThisCustomer = TestItem; //add the record PrimaryKey = ACustomer.Add(); //set the primary key of the test data TestItem.customerid = PrimaryKey; //find the record ACustomer.ThisCustomer.Find(PrimaryKey); //test to see if the two values are the same Assert.AreEqual(ACustomer.ThisCustomer, TestItem); }
protected void Page_Load(object sender, EventArgs e) { clsCustomerDetails customerdetails = new clsCustomerDetails(); customerdetails = (clsCustomerDetails)Session["CustomerDetails"]; Response.Write(customerdetails.setCustomerName); }
public void MarketingPreferncesOk() { clsCustomerDetails customerdetails = new clsCustomerDetails(); Boolean TestData = true; customerdetails.setMarketingPreferences = TestData; Assert.AreEqual(customerdetails.setMarketingPreferences, TestData); }
public void EmailOk() { clsCustomerDetails customerdetails = new clsCustomerDetails(); String TestData = "*****@*****.**"; customerdetails.setEmail = TestData; Assert.AreEqual(customerdetails.setEmail, TestData); }
public void ContactNumOk() { clsCustomerDetails customerdetails = new clsCustomerDetails(); String TestData = "0800 118 118"; customerdetails.setContactNum = TestData; Assert.AreEqual(customerdetails.setContactNum, TestData); }
public void DoBisOk() { clsCustomerDetails customerdetails = new clsCustomerDetails(); DateTime TestData = DateTime.Now.Date; customerdetails.setDoB = TestData; Assert.AreEqual(customerdetails.setDoB, TestData); }
public void CustomerNameisOk() { clsCustomerDetails customerdetails = new clsCustomerDetails(); String TestData = "John Doe"; customerdetails.setCustomerName = TestData; Assert.AreEqual(customerdetails.setCustomerName, TestData); }
public void CustomerIDisOk() { clsCustomerDetails customerdetails = new clsCustomerDetails(); int TestData = 0; customerdetails.setCustomerID = TestData; Assert.AreEqual(customerdetails.setCustomerID, TestData); }
public void UpdateMethodOk() { //create an instance of the class we want to create clsCustomerCollection ACustomer = new clsCustomerCollection(); //create the item of test data clsCustomerDetails TestItem = new clsCustomerDetails(); //var to store the primary key Int32 PrimaryKey = 0; //set its properties TestItem.username = "******"; TestItem.password = "******"; TestItem.firstname = "Upesh"; TestItem.lastname = "Chavda"; TestItem.emailaddress = "*****@*****.**"; TestItem.mobilenumber = "07754885553"; TestItem.cardnumber = "02365153439"; TestItem.secruitycode = "454"; TestItem.expirydate = DateTime.Now.Date; TestItem.addressName = "44A"; TestItem.streetname = "Newarke Close"; TestItem.cityname = "Leicester"; TestItem.postcode = "LE2 7GZ"; //set ThisCustomer to the test data ACustomer.ThisCustomer = TestItem; //add the record PrimaryKey = ACustomer.Add(); //set the primary key TestItem.customerid = PrimaryKey; //modify the test data TestItem.username = "******"; TestItem.password = "******"; TestItem.firstname = "Updfh"; TestItem.lastname = "Chavsaa"; TestItem.emailaddress = "*****@*****.**"; TestItem.mobilenumber = "07754395553"; TestItem.cardnumber = "02365147439"; TestItem.secruitycode = "414"; TestItem.expirydate = DateTime.Now.Date; TestItem.addressName = "48A"; TestItem.streetname = "Newarke street"; TestItem.cityname = "Leiceeghnner"; TestItem.postcode = "LE2 6GP"; //set the record based on the new test data ACustomer.ThisCustomer = TestItem; //update the record ACustomer.Update(); //find the record ACustomer.ThisCustomer.Find(PrimaryKey); //test to see ThisCustomer matches the test data Assert.AreEqual(ACustomer.ThisCustomer, TestItem); }
public void AddressisOk() { clsCustomerDetails customerdetails = new clsCustomerDetails(); List <String> TestData = new List <string>(); TestData.Add("221b"); TestData.Add("Baker Street"); TestData.Add("London"); TestData.Add("England"); customerdetails.setAddress = TestData; Assert.AreEqual(customerdetails.setAddress, TestData); }
public void InstanceOk() { clsCustomerDetails NewPage = new clsCustomerDetails(); Assert.IsNotNull(NewPage); }
public void InstanceOk() { clsCustomerDetails customerdetails = new clsCustomerDetails(); Assert.IsNotNull(customerdetails); }