Ejemplo n.º 1
0
        public void ValidMethodOK()
        {
            clsCostumer aCostumer = new clsCostumer();
            string      Error     = "";

            Error = aCostumer.Valid(CostumerID, Name, CostumerAddress, CostumerDOB, Email, Active);
            Assert.AreEqual(Error, "");
        }
Ejemplo n.º 2
0
        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);

    }
Ejemplo n.º 4
0
        public void CostumerAddressMin()
        {
            clsCostumer staff = new clsCostumer();
            string      Error = "";

            CostumerAddress = "a";
            Error           = aCostumer.Valid(CostumerID, Name, CostumerAddress, CostumerDOB, Email, Active);
            Assert.AreEqual(Error, "");
        }
Ejemplo n.º 5
0
        public void NameMinLessOne()
        {
            clsCostumer aCostumer = new clsCostumer();
            string      Error     = "";

            Name  = "";
            Error = aCostumer.Valid(CostumerID, Name, CostumerAddress, CostumerDOB, Email, Active);
            Assert.AreNotEqual(Error, "");
        }
Ejemplo n.º 6
0
        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, "");
        }
Ejemplo n.º 7
0
        public void CostumerAddressOK()
        {
            clsCostumer ACostumer = new clsCostumer();

            string TestData = "$0 Glenfield Road";

            ACostumer.CostumerAddress = TestData;

            Assert.AreEqual(ACostumer.CostumerAddress, TestData);
        }
Ejemplo n.º 8
0
        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, "");
        }
Ejemplo n.º 9
0
        public ActveOK()
        {
            clsCostumer ACostumer = new clsCostumer();

            Boolean TestData = true;

            ACostumer.Active = TestData;

            Assert.AreEqual(ACostumer.Active, TestData);
        }
Ejemplo n.º 10
0
        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, "");
        }
Ejemplo n.º 11
0
        public NamePropertyOK()
        {
            clsCostumer ACostumer = new clsCostumer();

            string TestData = "james";

            ACostumer.Name = TestData;

            Assert.AreEqual(ACostumer.Name, TestData);
        }
Ejemplo n.º 12
0
        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, "");
        }
Ejemplo n.º 13
0
        public void CostumerIDOK()
        {
            clsCostumer ACostumer = new clsCostumer();

            Boolean Found = false;

            Int32 CostumerID = 1;

            Found = ACostumer.Find(CostumerID);

            Assert.IsTrue(Found);
        }
Ejemplo n.º 14
0
    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;

    }
Ejemplo n.º 15
0
        public void EmailOK()
        {
            clsCostumer ACostumer = new clsCostumer();

            Boolean Found = false;

            String Email = "*****@*****.**";

            Found = ACostumer.Find(Email);

            Assert.IsTrue(Found);
        }
Ejemplo n.º 16
0
        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, "");
        }
Ejemplo n.º 17
0
        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);
        }
Ejemplo n.º 18
0
        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);
        }
Ejemplo n.º 19
0
    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++;
        }
    }
Ejemplo n.º 20
0
        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);
        }
Ejemplo n.º 21
0
        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);
        }
Ejemplo n.º 22
0
        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);
        }
Ejemplo n.º 23
0
        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);
        }
Ejemplo n.º 24
0
        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);
        }
Ejemplo n.º 25
0
        public void InstanceOK()
        {
            clsCostumer ACostumer = new clsCostumer();

            Assert.IsNotNull(ACostumer);
        }