public void ValidMethodOK() { clsCostumer aCostumer = new clsCostumer(); string Error = ""; Error = aCostumer.Valid(CostumerID, Name, CostumerAddress, CostumerDOB, Email, Active); Assert.AreEqual(Error, ""); }
public void EmailMinPlusOne() { clsCostumer aCostumer = new clsCostumer(); string Error = ""; Email = "aa"; Error = aCostumer.Valid(CostumerID, Name, CostumerAddress, CostumerDOB, Email, Active); Assert.AreEqual(Error, ""); }
protected void Page_Load(object sender, EventArgs e) { clsCostumer ACostumer = new clsCostumer(); ACostumer = (clsCostumer)Session["ACostumer"]; Response.Write(ACostumer.CostumerID); }
public void CostumerAddressMin() { clsCostumer staff = new clsCostumer(); string Error = ""; CostumerAddress = "a"; Error = aCostumer.Valid(CostumerID, Name, CostumerAddress, CostumerDOB, Email, Active); Assert.AreEqual(Error, ""); }
public void NameMinLessOne() { clsCostumer aCostumer = new clsCostumer(); string Error = ""; Name = ""; Error = aCostumer.Valid(CostumerID, Name, CostumerAddress, CostumerDOB, Email, Active); Assert.AreNotEqual(Error, ""); }
public void NameMaxPlusOne() { clsCostumer aCostumer = new clsCostumer(); string Error = ""; Name = ""; Name = Name.PadRight(51, 'a'); Error = aCostumer.Valid(CostumerID, Name, CostumerAddress, CostumerDOB, Email, Active); Assert.AreNotEqual(Error, ""); }
public void CostumerAddressOK() { clsCostumer ACostumer = new clsCostumer(); string TestData = "$0 Glenfield Road"; ACostumer.CostumerAddress = TestData; Assert.AreEqual(ACostumer.CostumerAddress, TestData); }
public void EmailEXMax() { clsCostumer aCostumer = new clsCostumer(); string Error = ""; Email = ""; Email = Email.PadRight(500, 'a'); Error = aCostumer.Valid(CostumerID, Name, CostumerAddress, CostumerDOB, Email, Active); Assert.AreNotEqual(Error, ""); }
public ActveOK() { clsCostumer ACostumer = new clsCostumer(); Boolean TestData = true; ACostumer.Active = TestData; Assert.AreEqual(ACostumer.Active, TestData); }
public void CostumerAddressMid() { clsCostumer aCostumer = new clsCostumer(); string Error = ""; CostumerAddress = ""; CostumerAddress = CostumerAddress.PadRight(25, 'a'); Error = aCostumer.Valid(CostumerID, Name, CostumerAddress, CostumerDOB, Email, Active); Assert.AreEqual(Error, ""); }
public NamePropertyOK() { clsCostumer ACostumer = new clsCostumer(); string TestData = "james"; ACostumer.Name = TestData; Assert.AreEqual(ACostumer.Name, TestData); }
public void CostumerDOBMax() { clsCostumer aCostumer = new clsCostumer(); string Error = ""; DateTime TestDate; TestDate = DateTime.Now.Date; CostumerDOB = TestDate.ToString(); Error = staff.Valid(CostumerID, Name, CostumerAddress, CostumerDOB, Email, Active); Assert.AreEqual(Error, ""); }
public void CostumerIDOK() { clsCostumer ACostumer = new clsCostumer(); Boolean Found = false; Int32 CostumerID = 1; Found = ACostumer.Find(CostumerID); Assert.IsTrue(Found); }
protected void btnOK_Click(object sender, EventArgs e) { clsCostumer ACostumer = new clsCostumer(); ACostumer.Name = txtName.Text; ACostumer.CostumerID = Convert.ToInt32(this.txtCostumerID.Text); ACostumer.CostumerAddress = txtCostumerAddress.Text; ACostumer.Email = txtEmail.Text; ACostumer.Name = txtName.Text; }
public void EmailOK() { clsCostumer ACostumer = new clsCostumer(); Boolean Found = false; String Email = "*****@*****.**"; Found = ACostumer.Find(Email); Assert.IsTrue(Found); }
public void CostumerDOBEXMax() { clsCostumer aCostumer = new clsCostumer(); string Error = ""; DateTime TestDate; TestDate = DateTime.Now.Date; TestDate = TestDate.AddYears(100); CostumerDOB = TestDate.ToString(); Error = aCostumer.Valid(CostumerID, Name, CostumerAddress, CostumerDOB, Email, Active); Assert.AreNotEqual(Error, ""); }
public void CostumerDOBOK() { //create an instance of the class we want to create clsCostumer ACostumer = new clsCostumer(); //boolean variable to store the result of the validation Boolean Found = false; //create some test data to use with the method DateTime CostumerDOB = "" + DateTime.Now.Date; //invoke the method Found = ACostumer.Find(CostumerDOB); //test to see that the result is correct Assert.IsTrue(Found); }
public void ThisCostumerPropertyOK() { clsCostumerCollection AllCostumers = new clsCostumerCollection(); clsCostumer TestCostumer = new clsCostumer(); TestItem.Active = true; TestItem.CostumerID = 1; TestItem.CostumerDOB = DateTime.Now.Date; TestItem.CostumerAddress = "22 Grange Lane LE2 7NX"; TestItem.Name = "Natalia Stylianou"; TestItem.Email = "*****@*****.**"; AllCostumers.ThisCostumer = TestCostumer; Assert.AreEqual(AllCostumers.ThisCostumer, TestCostumer); }
void PopulateArray(clsDataConnection DB) { int Index = 0; int RecordCount = 0; RecordCount = DB.Count; mCostumerList = new List <clsCostumer>(); while (Index < RecordCount) { clsCostumer Costumer = new clsCostumer(); Costumer.CostumerID = Convert.ToInt32(DB.DataTable.Rows[Index]["CostumerID"]); Costumer.Name = Convert.ToString(DB.DataTable.Rows[Index]["CostumerName"]); Costumer.CostumerAddress = Convert.ToString(DB.DataTable.Rows[Index]["CostumerAddress"]); Costumer.CostumerDOB = Convert.ToDateTime(DB.DataTable.Rows[Index]["CostumerDOB"]); Costumer.Email = Convert.ToString(DB.DataTable.Rows[Index]["CostumerEmail"]); mCostumerList.Add(Costumer); Index++; } }
public void TestNameFound() { clsCostumer ACostumer = new clsCostumer(); Boolean Found = false; Boolean OK = true; String Name = "James"; Found = ACostumer.Find(Name); if (ACostumer.Name != "Test Name") { OK = false; } Assert.IsTrue(OK); }
public void TestCostumerDOBFound() { clsCostumer ACostumer = new clsCostumer(); Boolean Found = false; Boolean OK = true; DateTime CostumerDOB = "" + DateTime.Now.Date; Found = ACostumer.Find(CostumerDOB); if (ACostumer.CostumerDOB != Convert.ToDateTime("16/09/2015")) { OK = false; } Assert.IsTrue(OK); }
public void AddMethodOK() { clsCostumerCollection AllCostumers = new clsCostumerCollection(); clsCostumer TestItem = new clsCostumer(); int PrimaryKey = 0; TestCostumer.CostumerID = 1; TestCostumer.Name = "James"; TestCostumer.CostumerAddress = "40 Glenfield Road"; TestCostumer.CostumerDOB = DateTime.Now.Date; TestCostumer.Email = "*****@*****.**"; TestCostumer.Active = true; AllCostumers.ThisCostumer = TestItem; PrimaryKey = AllCostumers.Add(); AllCostumers.ThisCostumer.Find(PrimaryKey); Assert.AreEqual(AllCostumers.ThisCostumer, TestItem); }
public void DeleteMethodOK() { clsCostumerCollection AllCostumers = new clsCostumerCollection(); clsCostumer TestCostumer = new clsCostumer(); int PrimaryKey = 0; TestCostumer.CostumerID = 1; TestCostumer.Name = "James"; TestCostumer.CostumerAddress = "40 Glenfield Road"; TestCostumer.CostumerDOB = DateTime.Now.Date; TestCostumer.Email = "*****@*****.**"; TestCostumer.Active = true; PrimaryKey = AllCostumers.Add(); TestCostumer.CostumerID = PrimaryKey; AllCostumers.ThisCostumer.Find(PrimaryKey); AllCostumers.Delete(); Boolean Found = AllCostumers.ThisCostumer.Find(PrimaryKey); Assert.IsFalse(Found); }
public void CostumerListOK() { clsCostumerCollection AllCostumers = new clsCostumerCollection(); List <clsCostumer> TestList = new List <clsCostumer>(); clcCostumer TestItem = new clsCostumer(); TestItem.Active = true; TestItem.CostumerID = 1; TestItem.CostumerDOB = DateTime.Now.Date; TestItem.CostumerAddress = "22 Grange Lane LE2 7NX"; TestItem.Name = "Natalia Stylianou"; TestItem.Email = "*****@*****.**"; TestList.add(TestItem); AllCostumers.CostumerList = TestList; Assert.AreEqual(AllCostumers.CostumerList, TestList); }
public void InstanceOK() { clsCostumer ACostumer = new clsCostumer(); Assert.IsNotNull(ACostumer); }