コード例 #1
0
        public async void Task_GetProductCategoryByID_Return_NotFoundResult()
        {
            var controller        = new ProductCategoryController(context);
            var productcategoryId = 6;
            var Data = await controller.Display(productcategoryId);

            Assert.IsType <NotFoundResult>(Data);
        }
コード例 #2
0
        public async void Task_GetProductCategoryByID_MatchResult()
        {
            var controller = new ProductCategoryController(context);
            int id         = 1;
            var data       = await controller.Display(id);

            Assert.IsType <OkObjectResult>(data);
            var OkResult = data.Should().BeOfType <OkObjectResult>().Subject;
            var pro      = OkResult.Value.Should().BeAssignableTo <Categories>().Subject;

            Assert.Equal("Summer Collection", pro.CategoryName);
            Assert.Equal("Cotton Collection ", pro.CategoryDescription);
        }