Example #1
0
        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"))
                });
            }
        }
Example #2
0
        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);
        }