Beispiel #1
0
        public void CustomerPackService_GetById_CustomerPackExists_CustomerPackEntityReturned()
        {
            var result = _target.GetById(CustomerPackId);

            Assert.IsNotNull(result);
            Assert.AreEqual(CustomerPackId, result.Id);
        }
Beispiel #2
0
        public ActionResult DeleteCustomerPack(int id)
        {
            var result = new { Success = "True", Message = "Success" };

            try
            {
                var customerPack = _customerPackService.GetById(id);
                _customerPackService.Delete(customerPack);
            }
            catch (Exception ex)
            {
                _contextManager.ResponseManager.StatusCode = 500;
                _contextManager.ResponseManager.AppendHeader(ModelStateErrorNames.ErrorMessage, ex.Message);
                result = new { Success = "False", Message = ex.Message };
                ExceptionPolicy.HandleException(ex, ExceptionPolicies.General);
            }

            return(Json(result, JsonRequestBehavior.AllowGet));
        }