public HttpResponseMessage ProvisionService([FromBody] ServiceDto serviceDto) { try { Setup(); _logger.WriteLogEntry(_tenantId.ToString(), new List <object> { serviceDto }, string.Format(MethodBase.GetCurrentMethod().Name + " in " + _name), LogLevelType.Info); int orderId = _iOrderService.RetrieveOrderIdByExtIdAndExtCompanyId(serviceDto.ExternalOrderId, serviceDto.ExternalCompanyId); int companyId = _iOrderService.RetrieveCompanyIdByExtCompanyId(serviceDto.ExternalCompanyId); int serviceId = _iOrderService.RetrieveServiceIdByExtOrderIdAndExtIdAndExtCompanyId(serviceDto.ExternalOrderId, serviceDto.ExternalServiceId, serviceDto.ExternalCompanyId); var task = _iProvisioningEngineService.ProvisionService(orderId, serviceId, companyId, serviceDto.TestMode, serviceDto.SendResponse, serviceDto.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_Service() { var serviceStatus = _iProvisioningEngineService.ProvisionService(70, 54, 3, true, true, false, "Unit Test"); Assert.AreEqual(serviceStatus.Id, 0); }