Exemplo n.º 1
0
        public async Task <IActionResult> Details(Guid?id)
        {
            if (id == null)
            {
                return(NotFound());
            }
            var getOperation = await _bo.ReadAsync((Guid)id);

            if (!getOperation.Success)
            {
                return(OperationErrorBackToIndex(getOperation.Exception));
            }
            ;
            if (getOperation.Result == null)
            {
                return(NotFound());
            }


            var vm = CategoryInterestPointViewModel.Parse(getOperation.Result);

            ViewData["Title"] = "Category Interest Point";

            var crumbs = GetCrumbs();

            crumbs.Add(new BreadCrumb()
            {
                Action = "New", Controller = "CategoryInterestPoints", Icon = "fa-search", Text = "Detail"
            });

            ViewData["BreadCrumbs"] = crumbs;


            return(View(vm));
        }
        public void TestCreateCategoryInterestPointAsync()
        {
            BoraNowSeeder.Seed();
            var cipbo = new CategoryInterestPointBusinessObject();

            var categoryInterestPoint = new CategoryInterestPoint("B");


            var resCreate = cipbo.CreateAsync(categoryInterestPoint).Result;
            var resGet    = cipbo.ReadAsync(categoryInterestPoint.Id).Result;

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