public void T2_Index_Get_RetrievesAllPermissionsFromRepository()
        {
            // Arrange
            Permission Permission1 = GetPermissionNamed(1, "Howth");
            Permission Permission2 = GetPermissionNamed(2, "Donnybrook");
            InMemoryPermissionRepository repository = new InMemoryPermissionRepository();
            repository.Add(Permission1);
            repository.Add(Permission2);
            var controller = GetHomeController(repository);

            // Act
            var result = controller.Index();

            // Assert
            var model = (IEnumerable<Permission>)result.ViewData.Model;
            CollectionAssert.Contains(model.ToList(), Permission1);
            CollectionAssert.Contains(model.ToList(), Permission2);
        }
        public void T9_Illegal_Record()
        {
            // Arrange
            Regex pattern = new Regex("^[^\u003c\u003e\u0026\u0022\u0027\u002f]{1,2000}$");
            Permission PermissionIllegal = GetPermissionIllegal();
            InMemoryPermissionRepository repository = new InMemoryPermissionRepository();
            repository.Add(PermissionIllegal);

            var controller = GetHomeController(repository);

            // Act
            var result = controller.Index();

            // Assert
            var model = (IEnumerable<Permission>)result.ViewData.Model;
            string modelString = System.Convert.ToString(model.ToList());
            StringAssert.Matches(modelString, pattern);
        }
        public void T7_Check_for_Invalid_Characters()
        {
            List<Permission> permrecs = new List<Permission>();
            InMemoryPermissionRepository repository = new InMemoryPermissionRepository();
            foreach (Permission r in permrecs)
            {
                repository.Add(r);
            }

            // Arrange
            Regex pattern = new Regex("^[^\u003c\u003e\u0026\u0022\u0027\u002f]{1,2000}$");

            var controller = GetHomeController(repository);

            // Act
            var result = controller.Index();

            // Assert
            var model = (IEnumerable<Permission>)result.ViewData.Model;

            string modelString = System.Convert.ToString(model);
            StringAssert.Matches(modelString, pattern);
        }