public void TestDeleteInterestPointCategory() { BoraNowSeeder.Seed(); var bo = new CategoryInterestPointBusinessObject(); 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 TestListCategoryInterestPoint() { BoraNowSeeder.Seed(); var cipbo = new CategoryInterestPointBusinessObject(); var resList = cipbo.List(); Assert.IsTrue(resList.Success && resList.Result.Count == 1); }
public void TestUpdatetCategoryInterestPoint() { BoraNowSeeder.Seed(); var cipbo = new CategoryInterestPointBusinessObject(); var resList = cipbo.List(); var item = resList.Result.FirstOrDefault(); var categoryInterestPoint = new CategoryInterestPoint("C"); item.Name = categoryInterestPoint.Name; var resUpdate = cipbo.Update(item); resList = cipbo.List(); Assert.IsTrue(resUpdate.Success && resList.Success && resList.Result.First().Name == categoryInterestPoint.Name); }
public ActionResult <List <CategoryInterestPointViewModel> > List() { var res = _bo.List(); if (!res.Success) { return(new ObjectResult(HttpStatusCode.InternalServerError)); } var list = new List <CategoryInterestPointViewModel>(); foreach (var item in res.Result) { list.Add(CategoryInterestPointViewModel.Parse(item)); } return(list); }