public void GetFinalPriceForItems_TestForEmptyScenario()
        {
            #region Assign
            var       expected  = 0;
            ItemOrder itemOrder = new ItemOrder();
            #endregion Assign

            #region Act
            var actual = _businessPromotionManager.GetFinalPriceForItems(itemOrder);
            #endregion Act

            #region Assert
            Assert.Equal(actual, expected);
            #endregion Assert
        }
示例#2
0
 public ActionResult GetFinalPriceForItems([FromBody] ItemOrder itemOrders)
 {
     try
     {
         _logger.LogInformation("GetFinalPriceForItems() execution is initiated..");
         if (itemOrders != null)
         {
             var response = _businessPromotionManager.GetFinalPriceForItems(itemOrders);
             _logger.LogInformation("GetFinalPriceForItems() execution is completed..");
             return(Ok(response));
         }
         else
         {
             _logger.LogInformation("GetFinalPriceForItems() execution is completed..");
             return(BadRequest());
         }
     }
     catch (Exception ex)
     {
         _logger.LogInformation("GetFinalPriceForItems() execution throwed an exception..");
         return(StatusCode(500, ex.Message));
     }
 }