public ActionResult <QuizViewModel> Get(Guid id) { var res = _bo.Read(id); if (res.Success) { if (res.Result == null) { return(NotFound()); } var cvm = QuizViewModel.Parse(res.Result); return(cvm); } else { return(new ObjectResult(HttpStatusCode.InternalServerError)); } }
public void TestCreateQuiz() { BoraNowSeeder.Seed(); var _quiz = new Quiz("Questionário BoraNow"); var _bo = new QuizBusinessObject(); var resCreate = _bo.Create(_quiz); var resGet = _bo.Read(_quiz.Id); Assert.IsTrue(resCreate.Success && resGet.Success && resGet.Result != null); }