public void TestInitCatalogCoupon()
        {
            //making sure the table is empty
            TestBuisness.clearAllTable();

            uAdmin         = new Users_SystemAdministrator();
            user2          = new User();
            user2.userName = "******";
            uAdmin.User    = user2;
            cat1           = new CatalogCoupon();
            cat1.catalogID = 123;
            cat1.Users_SystemAdministrator = uAdmin;
            ca_da           = new CatalogCouponDataAccess();
            cat1.CouponName = "free resert";
            user1           = new User();
            c1                     = new Category();
            b1                     = new Buisness();
            l1                     = new Location();
            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;
        }
 public void removeCategory()
 {
     cat_da.addCategory(cat2);
     Assert.IsTrue(cat_da.existsCategory(cat2));
     cat_da.removeCategory(cat2);
     Assert.IsFalse(cat_da.existsCategory(cat2));
     TestBuisness.clearAllTable();
 }
 public void removeLocation()
 {
     loc_da.addLocation(l1);
     Assert.IsTrue(loc_da.existsLocation(l1));
     loc_da.removeLocation(l1);
     Assert.IsFalse(loc_da.existsLocation(l1));
     TestBuisness.clearAllTable();
 }
Пример #4
0
 public void removeUsers_SystemAdministrator()
 {
     users_da.addUsers_SystemAdministrator(us);
     Assert.IsTrue(users_da.existsUsers_SystemAdministrator(us));
     users_da.removeUsers_SystemAdministrator(us);
     Assert.IsFalse(users_da.existsUsers_SystemAdministrator(us));
     TestBuisness.clearAllTable();
 }
 public void removeUsers_SystemAdministrator()
 {
     buis_da.addUsers_BuisnessOwner(ub);
     Assert.IsTrue(buis_da.existsUsers_BuisnessOwner(ub));
     buis_da.removeUsers_BuisnessOwner(ub);
     Assert.IsFalse(buis_da.existsUsers_BuisnessOwner(ub));
     TestBuisness.clearAllTable();
 }
 public void removeOrderedCoupon()
 {
     or_da.addOrderedCoupons(ordCoup);
     Assert.IsTrue(or_da.existsOrderedCoupons(ordCoup));
     or_da.removeOrderedCoupons(ordCoup);
     Assert.IsFalse(or_da.existsOrderedCoupons(ordCoup));
     TestBuisness.clearAllTable();
 }
 public void removeSocialNetwork()
 {
     soCup_da.addSocialNetworkCoupon(socCoup);
     Assert.IsTrue(soCup_da.existsSocialNetworkCoupon(socCoup));
     soCup_da.removeSocialNetworkCoupon(socCoup);
     Assert.IsFalse(soCup_da.existsSocialNetworkCoupon(socCoup));
     TestBuisness.clearAllTable();
 }
Пример #8
0
 public void removeBuisness()
 {
     buisness_da.addBuisness(b1);
     Assert.IsTrue(buisness_da.existsBuisness(b1));
     buisness_da.removeBuisness(b1);
     Assert.IsFalse(buisness_da.existsBuisness(b1));
     TestBuisness.clearAllTable();
 }
 public void removeUserCostumer()
 {
     customer_da.addUsers_Customer(uc1);
     Assert.IsTrue(customer_da.existsUsers_Customer(uc1));
     customer_da.removeUsers_Customer(uc1);
     Assert.IsFalse(customer_da.existsUsers_Customer(uc1));
     TestBuisness.clearAllTable();
 }
        public void updateOriginWebsite()
        {
            soCup_da.addSocialNetworkCoupon(socCoup);
            Assert.IsTrue(soCup_da.existsSocialNetworkCoupon(socCoup));
            string newWeb = "www,test.co.il";

            soCup_da.updateWebSite(socCoup, newWeb);
            Assert.AreEqual(socCoup.origionWebsite, newWeb);
            TestBuisness.clearAllTable();
        }
        public void updateDateTime()
        {
            soCup_da.addSocialNetworkCoupon(socCoup);
            Assert.IsTrue(soCup_da.existsSocialNetworkCoupon(socCoup));
            DateTime newDate = new DateTime(2020, 1, 1);

            soCup_da.updateDateTime(socCoup, newDate);
            Assert.AreEqual(socCoup.CatalogCoupon.deadLineForUse, newDate);
            TestBuisness.clearAllTable();
        }
        public void updateOrderedCouponRank()
        {
            or_da.addOrderedCoupons(ordCoup);
            Assert.IsTrue(or_da.existsOrderedCoupons(ordCoup));
            short newValue = 5;

            or_da.updateOrderedCouponRank(ordCoup, newValue);
            Assert.AreEqual(ordCoup.rank, newValue);
            TestBuisness.clearAllTable();
        }
        public void updateOrderedCouponsDateOfUses()
        {
            or_da.addOrderedCoupons(ordCoup);
            Assert.IsTrue(or_da.existsOrderedCoupons(ordCoup));
            DateTime newValue = new DateTime(2013, 4, 9);

            or_da.updateOrderedCouponsDateOfUse(ordCoup, newValue);
            Assert.AreEqual(ordCoup.dateOfUse, newValue);
            TestBuisness.clearAllTable();
        }
        public void updatOrderedCouponsPriceAfterDiscount()
        {
            or_da.addOrderedCoupons(ordCoup);
            Assert.IsTrue(or_da.existsOrderedCoupons(ordCoup));
            int newValue = 5;

            or_da.updatOrderedCouponsPriceAfterDiscount(ordCoup, newValue);
            Assert.AreEqual(ordCoup.CatalogCoupon.priceAfterDiscount, newValue);
            TestBuisness.clearAllTable();
        }
        public void updateOrderedisUsed()
        {
            or_da.addOrderedCoupons(ordCoup);
            Assert.IsTrue(or_da.existsOrderedCoupons(ordCoup));
            bool newValue = true;

            or_da.updateOrderedisUsed(ordCoup, newValue);
            Assert.AreEqual(ordCoup.isUsed, newValue);
            TestBuisness.clearAllTable();
        }
        public void updateOrderedCouponsCouponName()
        {
            or_da.addOrderedCoupons(ordCoup);
            Assert.IsTrue(or_da.existsOrderedCoupons(ordCoup));
            string newValue = "newName";

            or_da.updateOrderedCouponsCouponName(ordCoup, newValue);
            Assert.AreEqual(ordCoup.CatalogCoupon.CouponName, newValue);
            TestBuisness.clearAllTable();
        }
        public void updateOrderedCouponsDeadLineForUse()
        {
            or_da.addOrderedCoupons(ordCoup);
            Assert.IsTrue(or_da.existsOrderedCoupons(ordCoup));
            DateTime newValue = new DateTime(2016, 1, 1);

            or_da.updateOrderedCouponsDeadLineForUse(ordCoup, newValue);
            Assert.AreEqual(ordCoup.CatalogCoupon.deadLineForUse, newValue);
            TestBuisness.clearAllTable();
        }
        public void updatePriceAfterDiscount()
        {
            soCup_da.addSocialNetworkCoupon(socCoup);
            Assert.IsTrue(soCup_da.existsSocialNetworkCoupon(socCoup));
            double newPrice = 8.9;

            soCup_da.updatPriceAfterDiscount(socCoup, newPrice);
            Assert.AreEqual(socCoup.CatalogCoupon.priceAfterDiscount, newPrice);
            TestBuisness.clearAllTable();
        }
        public void updateLocation()
        {
            loc_da.addLocation(l1);
            Assert.IsTrue(loc_da.existsLocation(l1));
            string str = "Ashdod";

            loc_da.updaetCity(l1, str);
            Assert.AreEqual(l1.city, str);
            TestBuisness.clearAllTable();
        }
        public void updateCouponName()
        {
            soCup_da.addSocialNetworkCoupon(socCoup);
            Assert.IsTrue(soCup_da.existsSocialNetworkCoupon(socCoup));
            string newName = "AGADIR";

            soCup_da.updateCouponName(socCoup, newName);
            Assert.AreEqual(socCoup.CatalogCoupon.CouponName, newName);
            TestBuisness.clearAllTable();
        }
Пример #21
0
        public void updateSystemAdministratorEmail()
        {
            users_da.addUsers_SystemAdministrator(us);
            Assert.IsTrue(users_da.existsUsers_SystemAdministrator(us));
            String nwEmail = "*****@*****.**";

            users_da.updateEmail(us, nwEmail);
            Users_SystemAdministrator afterUpdate = users_da.findUsers_SystemAdministrator(us);

            Assert.AreEqual(nwEmail, us.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 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 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();
        }
Пример #26
0
        public void updateSystemAdministratorName()
        {
            users_da.addUsers_SystemAdministrator(us);
            Assert.IsTrue(users_da.existsUsers_SystemAdministrator(us));
            String nwName = "Dor";

            users_da.updateName(us, nwName);
            Users_SystemAdministrator afterUpdate = users_da.findUsers_SystemAdministrator(us);

            Assert.AreEqual(nwName, us.User.fullName);
            TestBuisness.clearAllTable();
        }
Пример #27
0
        public void updateSystemAdministratorPhone()
        {
            users_da.addUsers_SystemAdministrator(us);
            Assert.IsTrue(users_da.existsUsers_SystemAdministrator(us));
            String nwPhone = "0009987766";

            users_da.updatePhone(us, nwPhone);
            Users_SystemAdministrator afterUpdate = users_da.findUsers_SystemAdministrator(us);

            Assert.AreEqual(nwPhone, us.User.phone);
            TestBuisness.clearAllTable();
        }
        public void updateSystemAdministratorEmail()
        {
            buis_da.addUsers_BuisnessOwner(ub);
            Assert.IsTrue(buis_da.existsUsers_BuisnessOwner(ub));
            String nwEmail = "*****@*****.**";

            buis_da.updateEmail(ub, nwEmail);
            Users_BuisnessOwner afterUpdate = buis_da.findUsers_BuisnessOwner(ub);

            Assert.AreEqual(nwEmail, ub.User.email);
            TestBuisness.clearAllTable();
        }
        public void updateSystemAdministratorPhone()
        {
            buis_da.addUsers_BuisnessOwner(ub);
            Assert.IsTrue(buis_da.existsUsers_BuisnessOwner(ub));
            String nwPhone = "0009987766";

            buis_da.updatePhone(ub, nwPhone);
            Users_BuisnessOwner afterUpdate = buis_da.findUsers_BuisnessOwner(ub);

            Assert.AreEqual(nwPhone, ub.User.phone);
            TestBuisness.clearAllTable();
        }
Пример #30
0
        public void updateSystemAdministratorPassword()
        {
            users_da.addUsers_SystemAdministrator(us);
            Assert.IsTrue(users_da.existsUsers_SystemAdministrator(us));
            String nwPassword = "******";

            users_da.updatePassword(us, nwPassword);
            Users_SystemAdministrator afterUpdate = users_da.findUsers_SystemAdministrator(us);

            Assert.AreEqual(nwPassword, us.User.password);
            TestBuisness.clearAllTable();
        }