public void crud_process_succeeds()
        {
            var applicationRole = new ApplicationRole
            {
                Id       = 99999,
                RoleName = "MyTestRoleGoesHere"
            };

            var savedRole   = _repository.Add(applicationRole);
            var updatedRole = _repository.GetById(savedRole.Id);

            using (new AssertionScope())
            {
                savedRole.Should().NotBeNull();
                savedRole.Id.Should().Be(99999);
                savedRole.RoleName.Should().Be("MyTestRoleGoesHere");
                updatedRole.Id.Should().Be(savedRole.Id);

                updatedRole.RoleName = "MyNewTestRoleGoesHere";
                _repository.Update(updatedRole);

                updatedRole = _repository.GetById(savedRole.Id);
                updatedRole.RoleName.Should().Be("MyNewTestRoleGoesHere");

                _repository.Delete(updatedRole);
                _repository.GetById(savedRole.Id).Should().BeNull();
            }
        }
        public ActionResult Create(ApplicationRole applicationRole)
        {
            if (string.IsNullOrEmpty(applicationRole.Name))
            {
                ModelState.AddModelError("Errors", "Name is required, up to 128 characters!");

                var applicationRoles = applicationRoleRepository.GetApplicationRoles();

                var viewModel = new ApplicationRoleContainerViewModel(applicationRoles);

                return(View("Index", viewModel));
            }

            applicationRole.MakeActive();
            applicationRoleRepository.Add(applicationRole);
            unitOfWork.Complete();

            return(RedirectToAction("Index"));
        }