public void TesDeletetQuiz() { BoraNowSeeder.Seed(); var bo = new QuizBusinessObject(); var resList = bo.List(); var resDelete = bo.Delete(resList.Result.First().Id); resList = bo.List(); Assert.IsTrue(resDelete.Success && resList.Success && resList.Result.First().IsDeleted); }
public void TestUpdateQuiz() { BoraNowSeeder.Seed(); var qbo = new QuizBusinessObject(); var resList = qbo.List(); var quiz = resList.Result.FirstOrDefault(); var newQuiz = new Quiz("BoraNow Quiz"); quiz.Title = newQuiz.Title; var resUpdate = qbo.Update(quiz); resList = qbo.List(); Assert.IsTrue(resUpdate.Success && resList.Success && resList.Result.First().Title == quiz.Title); }
public void TestListQuiz() { BoraNowSeeder.Seed(); var bo = new QuizBusinessObject(); var resList = bo.List(); Assert.IsTrue(resList.Success && resList.Result.Count == 1); }
public ActionResult <List <QuizViewModel> > List() { var res = _bo.List(); if (!res.Success) { return(new ObjectResult(HttpStatusCode.InternalServerError)); } var list = new List <QuizViewModel>(); foreach (var item in res.Result) { list.Add(QuizViewModel.Parse(item)); } return(list); }