public HttpResponseMessage maisVotado() { IRelatorioBO relatorioBO = new RelatorioBO(); Retorno retorno = new Retorno(); try { retorno = relatorioBO.getGanhadoresMaisVotados(); return(new HttpResponseMessage(HttpStatusCode.Created) { Content = new ObjectContent <Retorno>(retorno, new JsonMediaTypeFormatter(), new MediaTypeWithQualityHeaderValue("application/json")) }); } catch (Exception ex) { retorno.status = false; retorno.mensagem = ex.Message; return(new HttpResponseMessage(HttpStatusCode.InternalServerError) { Content = new ObjectContent <Retorno>(retorno, new JsonMediaTypeFormatter(), new MediaTypeWithQualityHeaderValue("application/json")) }); } }
public HttpResponseMessage parcial() { IRelatorioBO relatorioBO = new RelatorioBO(); Retorno retorno = new Retorno(); DateTime thisDay = DateTime.Now; try { retorno = relatorioBO.getVotacaoParcialByData(thisDay); return(new HttpResponseMessage(HttpStatusCode.Created) { Content = new ObjectContent <Retorno>(retorno, new JsonMediaTypeFormatter(), new MediaTypeWithQualityHeaderValue("application/json")) }); } catch (Exception ex) { retorno.status = false; retorno.mensagem = ex.Message; return(new HttpResponseMessage(HttpStatusCode.InternalServerError) { Content = new ObjectContent <Retorno>(retorno, new JsonMediaTypeFormatter(), new MediaTypeWithQualityHeaderValue("application/json")) }); } }
public void getGanhadoresMaisVotados() { Retorno retorno = new Retorno(); IRelatorioBO relatorioBO = new RelatorioBO(); retorno = relatorioBO.getGanhadoresMaisVotados(); Assert.AreEqual(true, retorno.status, retorno.mensagem); }
public void testeParcial() { Retorno retorno = new Retorno(); IRelatorioBO relatorioBO = new RelatorioBO(); DateTime thisDay = DateTime.Now; retorno = relatorioBO.getVotacaoParcialByData(thisDay); Assert.AreEqual(true, retorno.status, retorno.mensagem); }