Exemplo n.º 1
0
        public ActionResult <NewsletterViewModel> Get(Guid id)
        {
            var res = _bo.Read(id);

            if (res.Success)
            {
                if (res.Result == null)
                {
                    return(NotFound());
                }
                var vm = NewsletterViewModel.Parse(res.Result);
                return(vm);
            }
            else
            {
                return(new ObjectResult(HttpStatusCode.InternalServerError));
            }
        }
Exemplo n.º 2
0
        public void TestCreateNewsletter()
        {
            BoraNowSeeder.Seed();
            var nbo = new NewsletterBusinessObject();

            var news = new Newsletter("New in town, this doughnut place is nuts", "New in town");

            var resCreate = nbo.Create(news);
            var restGet   = nbo.Read(news.Id);

            Assert.IsTrue(resCreate.Success && restGet.Success && restGet.Result != null);
        }