public void DealsCoverageController_Get_IsNullorEmpty_ValidationAPIException(int dealnumber) { #region Arrange SetupUserIdentity(); SetupDealCoveragesRepository(out Mock <IDealCoveragesRepository> dealsCoverageRepository, dealnumber); #endregion #region Act var httpRequest = new HttpRequestMessage(new HttpMethod(AppSettings.HTTPGET), $"{AppSettings.BASEURL}{RouteHelper.DealsCoverageRoutePrefix}/{dealnumber}"); DealCoveragesManager dealCoveragesManager = new DealCoveragesManager(userManager.Object, cacheStoreManager.Object, mockLogManager.Object, new Mock <IDealCoveragesRepository>().Object, dealLockManager.Object, transformationManager); GlobalReAPIManager globalReAPIManager = new GlobalReAPIManager(userManager.Object, cacheStoreManager.Object, mockLogManager.Object, new Mock <IDealManager>().Object, new Mock <IDealStatusSummariesManager>().Object, new Mock <IPersonsManager>().Object, dealLockManager.Object, dealCoveragesManager, new Mock <INotesManager>().Object); DealsCoverageController dealsCoverageController = new DealsCoverageController(userManager.Object, globalReAPIManager) { Request = httpRequest, Configuration = new HttpConfiguration() }; #endregion #region Act & Assert System.Web.Http.IHttpActionResult response = null; try { response = dealsCoverageController.Get(dealnumber); } catch (Exception) { Assert.IsNull(response); } #endregion }
public static List<T> GetAwaitedContentList<T>(System.Web.Http.IHttpActionResult message) { return GetAwaitedContentList<T>(message.GetHttpResponseMessage()); }
public static List<T> GetContentListAsync<T>(System.Web.Http.IHttpActionResult createTestItemResponse) { var testItemContent = (System.Web.OData.Results.CreatedODataResult<List<T>>)createTestItemResponse; return testItemContent.Entity; }
public AddChallengeOnUnauthorizedResult(AuthenticationHeaderValue challenge, System.Web.Http.IHttpActionResult innerResult) { Challenge = challenge; InnerHttpResult = innerResult; }