public IHttpActionResult GetQuotaExpressions(string id) { AutomationManager.OfferObjectToOfferApiObject(AutomationManager.offers, true); String providerId = RequestContext.Principal.Identity.Name; AutomationManager.IProviderRepository.Setup(i => i.SelectByProviderId(It.IsAny<string>())).Returns(new ProviderObject() { ProviderId = providerId }); RequestContext.RouteData = new HttpRouteData(RequestContext.RouteData.Route, new HttpRouteValueDictionary { { "controller", "testoffers" } }); OffersManager = new OffersManager(AutomationManager.IOfferRepository.Object, AutomationManager.IOfferAttributeRepository.Object, AutomationManager.IProviderRepository.Object, AutomationManager.IAttributeRepository.Object, AutomationManager.ILiveMatch.Object, AutomationManager.IRespondentCatalog.Object, AutomationManager.IQuotaExpressionRepository.Object, AutomationManager.IQuotaMappingRepository.Object, AutomationManager.ISampleMappingRepository.Object, AutomationManager.IGMIStudy.Object, AutomationManager.ISteamStudy.Object, AutomationManager.IQuotaLiveMatch.Object); var result = new TestOffersController(OffersManager, this.Request, this.RequestContext).GetQuotaExpressions(id) as OkNegotiatedContentResult<OfferQuotaCellsResponse>; return Ok(result.Content); }
public IHttpActionResult GetAttributes(string id) { String apiUser = RequestContext.Principal.Identity.Name; OfferAttributesResponse _responseEnvelope = new OfferAttributesResponse(Request.Properties["requestId"].ToString(), true); AutomationManager.OfferObjectToOfferApiObject(AutomationManager.offers, true); AutomationManager.RespondentAttributeToOfferApiObject(AutomationManager.offers); RequestContext.RouteData = new HttpRouteData(RequestContext.RouteData.Route, new HttpRouteValueDictionary { { "controller", "testoffers" } }); OffersManager = new OffersManager(AutomationManager.IOfferRepository.Object, AutomationManager.IOfferAttributeRepository.Object, AutomationManager.IProviderRepository.Object, AutomationManager.IAttributeRepository.Object, AutomationManager.ILiveMatch.Object, AutomationManager.IRespondentCatalog.Object, AutomationManager.IQuotaExpressionRepository.Object, AutomationManager.IQuotaMappingRepository.Object, AutomationManager.ISampleMappingRepository.Object, AutomationManager.IGMIStudy.Object, AutomationManager.ISteamStudy.Object, AutomationManager.IQuotaLiveMatch.Object); var result = new TestOffersController(OffersManager, this.Request, this.RequestContext).GetAttributes(id) as OkNegotiatedContentResult<OfferAttributesResponse>; return Ok(result.Content); }