예제 #1
0
        public ActionResult Delete(Guid id)
        {
            var result = _bo.Delete(id);

            if (result.Success)
            {
                return(Ok());
            }
            return(new ObjectResult(HttpStatusCode.InternalServerError));
        }
        public ActionResult Delete(Guid id)
        {
            var result = _bo.Delete(id);

            if (result.Success)
            {
                return(Ok());
            }
            return(InternalServerError());
        }
예제 #3
0
        public void TestDeleteCourseAsync()
        {
            RestaurantSeeder.Seed();
            var bo        = new CourseBusinessObject();
            var resList   = bo.ListAsync().Result;
            var total     = resList.Result.Count;
            var resDelete = bo.Delete(resList.Result.First().Id);

            resList = bo.ListNonDeletedAsync().Result;
            Assert.IsTrue(resDelete.Success && resList.Success && resList.Result.Count == total - 1);
        }
예제 #4
0
        public void TestDeleteCourse()
        {
            ContextSeeders.Seed();
            var bo = new CourseBusinessObject();

            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);
        }