示例#1
0
        public void ShouldGrantPrivileges()
        {
            Privilege.GrantPrivileges(_identityName, new[] { "SeServiceLogonRight" });
            var privileges = Privilege.GetPrivileges(_identityName);

            Assert.That(privileges, Is.Not.Null);
            Assert.That(privileges, Contains.Item("SeServiceLogonRight"));
        }
示例#2
0
 public void ShouldRejectUnknownPrivilege()
 {
     Privilege.GrantPrivileges(_identityName, new[] { "UnknownPrivilege" });
 }
示例#3
0
 public void ShouldRejectUnknownPrivilege()
 {
     Assert.Throws(Is.TypeOf <Win32Exception>()
                   .And.Message.EqualTo("No such privilege. Indicates a specified privilege does not exist."),
                   () => { Privilege.GrantPrivileges(_identityName, new[] { "UnknownPrivilege" }); });
 }