public static void SavingProductsInCartAT1() { UserAT.GenerateRandoms(out var cookie, out var username, out var password); UserAT.RegisterUser(cookie, username, password); UserAT.LoginUser(cookie, username, password); var shopGuid = Tester.PBridge.OpenShop(cookie, "Name"); var productGuid = StoreOwnerAT.AddProductToShop(cookie, shopGuid, "Galaxy S9", "Cellphones", 2000, 10); var res = Tester.PBridge.AddProductToCart(cookie, shopGuid, productGuid, 1); Assert.IsTrue(res); }
public static void SavingProductsInCartAT2() { UserAT.GenerateRandoms(out var cookie, out var username, out var password); UserAT.RegisterUser(cookie, username, password); UserAT.LoginUser(cookie, username, password); var shopGuid = Tester.PBridge.OpenShop(cookie, "Name"); var productGuid = StoreOwnerAT.AddProductToShop(cookie, shopGuid, "Galaxy S9", "Cellphones", 2000, 10); var invalidProductGuid = Guid.Empty; Assert.Throws <ProductNotFoundException>( () => Tester.PBridge.AddProductToCart(cookie, shopGuid, invalidProductGuid, 1)); }
public static void SearchProductsAT2() { if (!Tester._groismanRegistered) { RegisterAT1(); } if (!Tester._groismanConnected) { LoginAT1(); } if (Tester._groismanShop.CompareTo(Guid.Empty) == 0) { RegisteredBuyerAT.OpenStoreAT1(); //the shop is empty and no product is available. } if (Tester.galaxyGuid.CompareTo(Guid.Empty) == 0) { StoreOwnerAT.AddingProductAT1(); //now Groisman's shop has 10 Galaxys } //TODO_REMOVE_COMMENT Assert.IsNotNull(Tester.PBridge.SearchProduct(Tester.GuestGuid, Tester._groismanShop, "IPhone 6")); }