public void setUp() { service = ServiceLayer.getInstance(false); DBtransactions db = DBtransactions.getInstance(true); db.isTest(true); idOwner = service.initUser(); ownerUser = "******"; passwordUser = "******"; service.register(ownerUser, passwordUser, idOwner); service.signIn(ownerUser, passwordUser); idUser = service.initUser(); tmpUser = "******"; passUser = "******"; service.register(tmpUser, passUser, idUser); service.openStore("adidas", ownerUser); service.createNewProductInStore("milk", "milk", "none", 10, "adidas", ownerUser); products = new List <KeyValuePair <String, int> >(); products.Add(new KeyValuePair <string, int>("milk", 7)); service.addProductsInStore(products, "adidas", ownerUser); productsInCart = new List <KeyValuePair <String, int> >(); productsInCart.Add(new KeyValuePair <string, int>("milk", 10)); }
public void setUp() { service = ServiceLayer.getInstance(false); idOwner = service.initUser(); DBtransactions db = DBtransactions.getInstance(true); db.isTest(true); ownerUser = "******"; passwordUser = "******"; service.register(ownerUser, passwordUser, idOwner); service.signIn(ownerUser, passwordUser); idManager = service.initUser(); managerUser = "******"; managerPassword = "******"; service.register(managerUser, managerPassword, idManager); permissions = new List <String>() { "AddDiscountPolicy" }; service.openStore("adidas", ownerUser); idGuest = service.initUser(); guestUser = "******"; password = "******"; }
public void TestMethod1_success_scenario() { setUp(); DBtransactions db = DBtransactions.getInstance(true); db.isTest(true); String userName = user1.UserName; String password = "******"; int userId = user1.Id; Assert.AreEqual(true, system.register(userName, password, userId)); }
public void TestMethod1_success_scenario() { setUp(); DBtransactions db = DBtransactions.getInstance(true); db.isTest(true); StubUser tmpUser = new StubUser(123, "yuval", "4567", false, false, true); String userName = tmpUser.UserName; String password = tmpUser.Password; int userId = tmpUser.Id; system.Users.Add(tmpUser.Id, tmpUser); Assert.AreEqual(true, system.register(userName, password, userId)); }
public void setUp() { service = ServiceLayer.getInstance(false); DBtransactions db = DBtransactions.getInstance(true); db.isTest(true); string owner = service.initUser(); service.register("Rotem", "23&As2", owner); service.signIn("Rotem", "23&As2"); service.openStore("ZARA", "Rotem"); string user = service.initUser(); service.register("Noy", "24!tr4", user); service.signIn("Noy", "24!tr4"); }
public void setUp() { service = ServiceLayer.getInstance(false); DBtransactions db = DBtransactions.getInstance(true); db.isTest(true); string owner = service.initUser(); service.register("Rotem", "23&As2", owner); service.signIn("Rotem", "23&As2"); service.openStore("ZARA", "Rotem"); string user = service.initUser(); service.register("Noy", "24!tr4", user); service.signIn("Noy", "24!tr4"); service.createNewProductInStore("Top", "Tank tops", "Light blue", 89, "ZARA", "Rotem"); products = new List <KeyValuePair <String, int> >(); products.Add(new KeyValuePair <string, int>("Top", 7)); service.addProductsInStore(products, "ZARA", "Rotem"); }