//___________________________________________________________________________ //This function call the method that return an information //We use an "Unity" from create instances of classes. //Params: // - IN:WebBedsGetDataQuery // -OUT:WebBBedsDataDto //___________________________________________________________________________ private WebBBedsDataDto GetWebBedsData(string destinationId, string numNights) { var myApplication = MyUnityContainer().Resolve <IQueryHandler <WebBedsGetDataQuery, WebBedsGetDataQueryResult> >(); var queryDto = new WebBedsGetDataQuery(); queryDto.DestinationId = ConvertNumeric(destinationId); queryDto.NumNights = ConvertNumeric(numNights); var resultData = myApplication.ExecuteQuery(queryDto); WebBBedsDataDto resultDto; resultDto = GetWebBedsDataHomeIndexTranslator.Instance.Translate(resultData); return(resultDto); }
public void GetWebBedsData() { try { var requestWebApiRepository = new Request(); var webBedsApiRepository = new WebBedsWebApiRepository(requestWebApiRepository); var query = new WebBedsGetDataQueryHandler(webBedsApiRepository); var queryDto = new WebBedsGetDataQuery() { DestinationId = 279, NumNights = 2 }; var result = query.ExecuteQuery(queryDto); Assert.IsNotNull(result); } catch (System.Exception) { Assert.Fail("Error in method ExecuteQuery of the WebBedsGetDataQueryHandler class"); } }