public void check_order_with_exception_cases(String param)
        {
            String[]           commandSplit       = param.Split(" ");
            ValidateParameters validateParameters = new ValidateParameters();

            Assert.Throws <Exception>(() => validateParameters.checkOrder(commandSplit));
        }
Пример #2
0
 public void createOrder(string[] order, PoolManager poolManager)
 {
     try
     {
         if (!Validate(order))
         {
             ErrorOrderParameters();
         }
         validateParameters.checkOrder(order);
         productController.setActivityProduct(poolManager);
         if (!(productController.isThereProduct(order[1], poolManager)))
         {
             NotFoundProductForSale();
         }
         Product product = productController.getProduct(order[1], poolManager);
         if (product._isInCampaign)
         {
             productController.isSaleAvailable(order, poolManager);
             campaignController.isSaleAvailable(campaignController.getCampaignWithProduct(product, poolManager), order);
             productController.doSale(order, poolManager);
             campaignController.doSale(order, product, poolManager);
             Run(order, poolManager);
         }
         else
         {
             productController.isSaleAvailable(order, poolManager);
             productController.doSale(order, poolManager);
             Run(order, poolManager);
         }
     }
     catch (Exception e)
     {
         throw new Exception(e.Message, e);
     }
 }
        public void check_order_without_exception_cases(String param)
        {
            String[]           commandSplit       = param.Split(" ");
            ValidateParameters validateParameters = new ValidateParameters();
            var exception = Record.Exception(() => validateParameters.checkOrder(commandSplit));

            Assert.Null(exception);
        }