public string GetHtmlBanner(List<SelectedFilter> selectedFilters, string codigo, string seccion, string eSection) { var banner = new Banner { Heigh = BannerDao.GetAttribute("alto", seccion, codigo), Width = BannerDao.GetAttribute("ancho", seccion, codigo), Provider = BannerDao.GetAttribute("proveedor", seccion, codigo).ToLower().Trim(), Behaviour = BannerDao.GetAttribute("comportamiento", seccion, codigo).ToLower().Trim(), Parameters = BannerDao.GetAttribute("parametros", seccion, codigo), Zone = BannerDao.GetAttribute("zona", seccion, codigo), Section = seccion, ESection = eSection, Code = codigo, Order = BannerDao.GetAttribute("orden", seccion, codigo), KeywordsProvider = new SearcParameterKeywordsProvider(selectedFilters, new Dictionary<string, string> { {"id_marca", "vehicle_make_id"}, {"id_model", "vehicle_model_id"}, {"provinci", "vehicle_loc_prov_id"}, {"localida", "vehicle_loc_loc_id"} }) }; return banner.GetHtml(); }
public void Banner_Tohtml_Should_Not_Be_Empty() { var keywordsProviderMock = new DynamicMock(typeof (IKeywordsProvider)); var parametersReturn = "kw_marcas=val1&kw_MarcMod=val2&kw_provincias=val3&kw_localidades=val4"; keywordsProviderMock.SetReturnValue("GetParametersString",parametersReturn); var banner = new Banner { KeywordsProvider = (IKeywordsProvider) (keywordsProviderMock.MockInstance), Behaviour = "parametros", Zone = "zone", Provider = "eplanning" }; var html = banner.GetHtml(); Assert.IsFalse(string.IsNullOrEmpty(html)); Assert.IsTrue(html.Contains(parametersReturn)); }
public string GetHtmlBanner(string codigo) { Random r = new Random(DateTime.Now.Millisecond); string seccion = r.Next(1,2)==1?"usados":"nuevos"; var banner = new Banner { Heigh = BannerDao.GetAttribute("alto", seccion, codigo), Width = BannerDao.GetAttribute("ancho", seccion, codigo), Provider = BannerDao.GetAttribute("proveedor", seccion, codigo).ToLower().Trim(), Behaviour = BannerDao.GetAttribute("comportamiento", seccion, codigo).ToLower().Trim(), Parameters = BannerDao.GetAttribute("parametros", seccion, codigo), Zone = BannerDao.GetAttribute("zona", seccion, codigo), Section = seccion, ESection = "eb", Code = codigo, Order = BannerDao.GetAttribute("orden", seccion, codigo), KeywordsProvider = new SearcParameterKeywordsProvider() }; return banner.GetHtml(); }