public void CanConfigure_DynamiPermissions()
        {
            PermissionElement element = new PermissionElement {Dynamic = true};

            var map = element.ToPermissionMap(Permission.Administer, null, null);

            Assert.That(map, Is.TypeOf(typeof(DynamicPermissionMap)));
        }
        public void CanConfigure_Permissions()
        {
            PermissionElement element = new PermissionElement { Dynamic = true };

            var map = element.ToPermissionMap(Permission.Administer, new[] {"role"}, new[] {"user"});

            Assert.That(map.Permissions, Is.EqualTo(Permission.Administer));
            Assert.That(map.Roles.Length, Is.EqualTo(1));
            Assert.That(map.Roles[0], Is.EqualTo("role"));
            Assert.That(map.Users.Length, Is.EqualTo(1));
            Assert.That(map.Users[0], Is.EqualTo("user"));
        }