예제 #1
0
        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);
        }
예제 #2
0
        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));
        }
예제 #3
0
파일: UserAT.cs 프로젝트: shachafn/wsep192
 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"));
 }