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")); }
public void ShouldRejectUnknownPrivilege() { Privilege.GrantPrivileges(_identityName, new[] { "UnknownPrivilege" }); }
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" }); }); }