public void ListAndCountAddressOK()
        {
            //create an instance of the class we want to create
            clsAddressCollection AllAddresses = new clsAddressCollection();
            //create test data to assign to the property
            //data needs to be a list of objects
            List <clsAddress> TestList = new List <clsAddress>();
            //add item to the list
            //create the item of test data
            clsAddress TestItem = new clsAddress();

            //set its properties
            TestItem.ChangeNo = 2;
            TestItem.HouseNo  = "123b";
            TestItem.Street   = "London Road";
            TestItem.Town     = "Leicester";
            TestItem.PostCode = "Le2 102";
            TestItem.Email    = "*****@*****.**";
            //add the item to the list
            TestList.Add(TestItem);
            //assign the data to the property
            AllAddresses.AddressList = TestList;
            //test to see that the two values are the same
            Assert.AreEqual(AllAddresses.Count, TestList.Count);
        }
        public void AddMethodAddressOK()
        {
            //create an instance of the class we want to create
            clsAddressCollection AllAddresses = new clsAddressCollection();
            //create the item of test data
            clsAddress TestItem = new clsAddress();
            //var to store the primary key
            Int32 PrimaryKey = 0;

            //set its properties
            TestItem.ChangeNo = 2;
            TestItem.HouseNo  = "123b";
            TestItem.Street   = "London Road";
            TestItem.Town     = "Leicester";
            TestItem.PostCode = "Le2 102";
            TestItem.Email    = "*****@*****.**";
            //set ThisOrder to the test data
            AllAddresses.ThisAddress = TestItem;
            //add the record
            PrimaryKey = AllAddresses.AddAddress();
            //set the primary key to the test data
            TestItem.ChangeNo = PrimaryKey;
            //find the record
            AllAddresses.ThisAddress.Find(PrimaryKey);

            //test to see that two values are the same
            Assert.AreEqual(AllAddresses.ThisAddress, TestItem);
        }
Пример #3
0
        public void InstanceOK()
        {
            //create an instance of the class we want to create
            clsAddress AnAddress = new clsAddress();

            //test to see that it exists
            Assert.IsNotNull(AnAddress);
        }
Пример #4
0
        public void InstanceOK()
        {
            //create an instance of our class clsAddress
            clsAddress AnAddress = new clsAddress();

            // check ti see that the class is not null
            Assert.IsNotNull(AnAddress);
        }
Пример #5
0
    protected void btnOK(object sender, EventArgs e)
    {
        //CREATE A NEW INSTANCE OF clsAddress
        clsAddress AnAddress = new clsAddress();

        //get data from session object
        AnAddress = (clsAddress)Session["AnAddress"];
        //display the hous enumber for this entry
        Response.Write(AnAddress.HouseNo);
    }
Пример #6
0
        public void DateAddedPropertyOK()
        {
            //create an instance of the class we want to create
            clsAddress AnAddress = new clsAddress();
            //create some test data to assign to the property
            DateTime TestData = DateTime.Now.Date;

            //assign the data to the property
            AnAddress.DateAdded = TestData;
            //test to see that the two values are the same
            Assert.AreEqual(AnAddress.DateAdded, TestData);
        }
Пример #7
0
        public void TownPropertyOK()
        {
            //create an instance of the class we want to create
            clsAddress AnAddress = new clsAddress();
            //create some test data to assign to the property
            string TestData = "Leicester";

            //assign the data to the property
            AnAddress.Town = TestData;
            //test to see that the two values are the same
            Assert.AreEqual(AnAddress.Town, TestData);
        }
Пример #8
0
        public void AddressNoPropertyOK()
        {
            //create an instance of the class we want to create
            clsAddress AnAddress = new clsAddress();
            //create some test data to assign to the property
            Int32 TestData = 1;

            //assign the data to the property
            AnAddress.AddressNo = TestData;
            //test to see that the two values are the same
            Assert.AreEqual(AnAddress.AddressNo, TestData);
        }
Пример #9
0
        public void ActivePropertyOK()
        {
            //create an instance of the class we want to create
            clsAddress AnAddress = new clsAddress();
            //create some test data to assign to the property
            Boolean TestData = true;

            //assign the data to the property
            AnAddress.Active = TestData;
            //test to see that the two values are the same
            Assert.AreEqual(AnAddress.Active, TestData);
        }
Пример #10
0
        private void setTestdata()
        {
            objCustomer = new clsCustomer();
            clsAddress objAddress = new clsAddress();
            clsPhone   objPhone   = new clsPhone();

            objCustomer.strCustomerName = "Shivprasad Koirala";
            objAddress.strAddress1      = "Mumbai";
            objAddress.strAddress2      = "Mulund";
            objPhone.strPhoneNumber     = "99881";
            objAddress.objPhones.Add(objPhone);
            objCustomer.objAddresses.Add(objAddress);
        }
Пример #11
0
        public void FindMethodOK()
        {
            //create an instance of the class we want to create
            clsAddress AnAddress = new clsAddress();
            //boolean variable to store the result of the validation
            Boolean Found = false;
            //create some test data to use with the method
            Int32 AddressNo = 1;

            //invoke the method
            Found = AnAddress.Find(AddressNo);
            //test to see that the result is correct
            Assert.IsTrue(Found);
        }
Пример #12
0
        public void FindMethodOK()
        {
            //CREATING THE FIND METHOD HANDOUT
            //CREATE AN INSTANCE OF THER CLASS YOU WANT TO CREATE
            clsAddress AnAddress = new clsAddress();
            //Boolean variable to store the result of the validation
            Boolean Found = false;
            //create some test data to use with the method
            Int32 AddressNo = 1;

            //invoke the method
            Found = AnAddress.Find(AddressNo);
            //test to see that the result is correct
            Assert.IsTrue(Found);
        }
Пример #13
0
    protected void Page_Load(object sender, EventArgs e)
    {
        //create a new instance of clsAddress
        clsAddress AnAddress = new clsAddress();

        //get the data from the the session object
        AnAddress = (clsAddress)Session["AnAddress"];
        //display the house number for this entry
        Response.Write(AnAddress.HouseNo);
        Response.Write(AnAddress.HouseNo);
        Response.Write(AnAddress.Street);
        Response.Write(AnAddress.Town);
        Response.Write(AnAddress.PostCode);
        Response.Write(AnAddress.County);
        Response.Write(AnAddress.DateAdded);
    }
        public void ThisAddressPropertyOK()
        {
            //create an instance of the class we want to create
            clsAddressCollection AllAddresses = new clsAddressCollection();
            //create the item of test data
            clsAddress TestAddress = new clsAddress();

            //set the properties of the test object
            TestAddress.ChangeNo = 2;
            TestAddress.HouseNo  = "123b";
            TestAddress.Street   = "London Road";
            TestAddress.Town     = "Leicester";
            TestAddress.PostCode = "Le2 102";
            TestAddress.Email    = "*****@*****.**";
            //assign the data to the property
            AllAddresses.ThisAddress = TestAddress;
            //test to see that the two values are equal
            Assert.AreEqual(AllAddresses.ThisAddress, TestAddress);
        }
Пример #15
0
        public void TestStreetFound()
        {
            //create an instance of the class we want to create
            clsAddress AnAddress = new clsAddress();
            //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 AddressNo = 21;

            //invoke the method
            Found = AnAddress.Find(AddressNo);
            //check the property
            if (AnAddress.Street != "Test Street")
            {
                OK = false;
            }
            //test to see that the result is correct
            Assert.IsTrue(OK);
        }
Пример #16
0
        public void TestAddressNoFound()
        {
            //CREATE AN INSTANCE OF THER CLASS YOU WANT TO CREATE
            clsAddress AnAddress = new clsAddress();
            //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 AddressNo = 21;

            //invoke the method
            Found = AnAddress.Find(AddressNo);
            //check the address no
            if (AnAddress.AddressNo != 21)
            {
                OK = false;
            }
            //test to see that the result is correct
            Assert.IsTrue(OK);
        }
Пример #17
0
    protected void btnOk_Click(object sender, EventArgs e)
    {
        //create a new instance of clsAddress
        clsAddress AnAddress = new clsAddress();

        //capture the house number
        AnAddress.HouseNo = txtHouseNo.Text;
        //capture the street name
        AnAddress.Street = txtStreet.Text;
        //capture the Town
        AnAddress.Town = txtTown.Text;
        //capture the post code
        AnAddress.PostCode = txtPostCode.Text;
        //capture the county
        AnAddress.County = txtCounty.Text;
        // capture Date Added
        AnAddress.DateAdded = Convert.ToDateTime(txtDateAdded.Text);
        //store the address in the session object
        Session["AnAddress"] = AnAddress;
        //Redirect to the viewer page
        Response.Redirect("AddressViewer.aspx");
    }
Пример #18
0
        public void InstanceOK()
        {
            clsAddress NewPage = new clsAddress();

            Assert.IsNotNull(NewPage);
        }
Пример #19
0
        public void TestAddress()
        {
            clsAddress AnAddress = new clsAddress();

            Assert.IsNotNull(AnAddress);
        }
Пример #20
0
        public void InstanceOK()
        {
            clsAddress Anaddress = new clsAddress();

            Assert.IsNotNull(Anaddress);
        }