public void updateCustomerEmail()
        {
            customer_da.addUsers_Customer(uc1);;
            Assert.IsTrue(customer_da.existsUsers_Customer(uc1));
            String nwEmail = "*****@*****.**";

            customer_da.updateEmail(uc1, nwEmail);
            Users_Customer afterUpdate = customer_da.findUsers_Customer(uc1);

            Assert.AreEqual(nwEmail, uc1.User.email);
            TestBuisness.clearAllTable();
        }
        public void updateCustomerPhone()
        {
            customer_da.addUsers_Customer(uc1);;
            Assert.IsTrue(customer_da.existsUsers_Customer(uc1));
            String nwPhone = "0009987766";

            customer_da.updatePhone(uc1, nwPhone);
            Users_Customer afterUpdate = customer_da.findUsers_Customer(uc1);

            Assert.AreEqual(nwPhone, uc1.User.phone);
            TestBuisness.clearAllTable();
        }
        public void updateCustomerPassword()
        {
            customer_da.addUsers_Customer(uc1);;
            Assert.IsTrue(customer_da.existsUsers_Customer(uc1));
            String nwPassword = "******";

            customer_da.updatePassword(uc1, nwPassword);
            Users_Customer afterUpdate = customer_da.findUsers_Customer(uc1);

            Assert.AreEqual(nwPassword, uc1.User.password);
            TestBuisness.clearAllTable();
        }
        public void updateCustomerName()
        {
            customer_da.addUsers_Customer(uc1);;
            Assert.IsTrue(customer_da.existsUsers_Customer(uc1));
            String nwName = "Dor";

            customer_da.updateName(uc1, nwName);
            Users_Customer afterUpdate = customer_da.findUsers_Customer(uc1);

            Assert.AreEqual(nwName, uc1.User.fullName);
            TestBuisness.clearAllTable();
        }
        public void addCustomerCategory()
        {
            customer_da.addUsers_Customer(uc1);;
            Assert.IsTrue(customer_da.existsUsers_Customer(uc1));
            Category c = new Category();

            c.catName = "food";
            customer_da.addCategory(uc1, c);
            Users_Customer afterUpdate = customer_da.findUsers_Customer(uc1);

            Assert.IsTrue(customer_da.existsCategoryUsers_Customer(uc1, c));
            TestBuisness.clearAllTable();
        }
        public void updateCustomerLocation()
        {
            customer_da.addUsers_Customer(uc1);;
            Assert.IsTrue(customer_da.existsUsers_Customer(uc1));
            Location newLoc = new Location();

            newLoc.latitude  = 34.5;
            newLoc.longitude = 31.8;
            customer_da.updateLocation(uc1, newLoc);
            Users_Customer afterUpdate = customer_da.findUsers_Customer(uc1);

            Assert.AreEqual(newLoc.longitude, afterUpdate.Location.longitude);
            Assert.AreEqual(newLoc.latitude, afterUpdate.Location.latitude);
            TestBuisness.clearAllTable();
        }
        public void TestInitOrderedCoupon()
        {
            //making sure the table is empty
            TestBuisness.clearAllTable();

            uAdmin         = new Users_SystemAdministrator();
            user2          = new User();
            user2.userName = "******";
            uCos           = new Users_Customer();
            user3          = new User();
            user3.userName = "******";
            uCos.User      = user3;
            uAdmin.User    = user2;
            cat1           = new CatalogCoupon();
            cat1.catalogID = 123;
            cat1.Users_SystemAdministrator = uAdmin;
            cat1.CouponName = "free resert";
            user1           = new User();
            c1                     = new Category();
            b1                     = new Buisness();
            l1                     = new Location();
            uCos.Location          = l1;
            l1.latitude            = 34.8999;
            l1.longitude           = 45.3666;
            ub1                    = new Users_BuisnessOwner();
            b1.BuisDescription     = "Sushi bar";
            b1.buisAddress         = "Aharom Meskin 13";
            b1.buisCity            = "Beer-Sheva";
            b1.buisName            = "JAPANIKA";
            user1.userName         = "******";
            c1.catName             = "food";
            ub1.User               = user1;
            b1.Users_BuisnessOwner = ub1;
            b1.Category            = c1;
            b1.Location            = l1;
            cat1.Category          = c1;
            cat1.Location          = l1;
            cat1.Buisness          = b1;
            ordCoup                = new OrderedCoupon();
            ordCoup.serialKey      = "serialKey";
            ordCoup.CatalogCoupon  = cat1;
            ordCoup.Users_Customer = uCos;

            or_da = new OrderedCouponDataAccess();
        }
        public void TestInitUserCostumer()
        {
            TestBuisness.clearAllTable();
            customer_da = new Users_CustomerDataAccess();
            u1          = new User();
            uc1         = new Users_Customer();
            u1.userName = "******";
            u1.fullName = "michael B";
            u1.password = "******";
            u1.phone    = "45385748";
            u1.email    = "*****@*****.**";
            uc1.User    = u1;
            Location l = new Location();

            l.latitude   = 34.8999;
            l.longitude  = 45.3666;
            uc1.Location = l;
            uc1.gender   = "Male";
            uc1.age      = 20;
        }