CapRaffle.UnitTests.CategoryControllerTests.Can_Edit_Existing_Category C# (CSharp) Метод

Can_Edit_Existing_Category() приватный Метод

private Can_Edit_Existing_Category ( ) : void
Результат void
        public void Can_Edit_Existing_Category()
        {
            var target = controller.Index();
            var categoryListViewModel = target.Model as CategoryListViewModel;

            var categoryToEdit = categoryListViewModel.Categories.First();
            ViewResult result = (ViewResult)controller.Edit(categoryToEdit.CategoryId);

            var categorySentToView = result.Model as Category;

            result.AssertViewRendered().ForView(string.Empty);
            Assert.AreEqual(categoryToEdit.Name, categorySentToView.Name);
            Assert.AreEqual(categoryToEdit.CategoryId, categorySentToView.CategoryId);
        }