public HttpResponseMessage ProvisionOrder([FromBody] OrderDto orderDto) { try { Setup(); _logger.WriteLogEntry(_tenantId.ToString(), new List <object> { orderDto }, string.Format(MethodBase.GetCurrentMethod().Name + " in " + _name), LogLevelType.Info); int orderId = _iOrderService.RetrieveOrderIdByExtIdAndExtCompanyId(orderDto.ExternalOrderId, orderDto.ExternalCompanyId); int companyId = _iOrderService.RetrieveCompanyIdByExtCompanyId(orderDto.ExternalCompanyId); var task = _iProvisioningEngineService.ProvisionOrder(orderId, companyId, orderDto.TestMode, orderDto.SendResponse, orderDto.ForceProvision, _user); Task.WaitAll(task); return(this.Request.CreateResponse(HttpStatusCode.OK, task.Result)); } catch (Exception ex) { _logger.WriteLogEntry(_tenantId.ToString(), new List <object> { ex.RetrieveEntityExceptionDataAsObjectList() }, string.Format(MethodBase.GetCurrentMethod().Name + " in " + _name), LogLevelType.Error, ex.GetInnerMostException()); throw ex.AddEntityValidationInfo(); } }
public void Can_Provision_Order() { var orderStatus = _iProvisioningEngineService.ProvisionOrder(70, 54, true, true, false, "Unit Test"); Assert.AreEqual(orderStatus.Id, 0); }