public void SetSddlForm () { TestSecurity security = new TestSecurity (); SecurityIdentifier groupSid = new SecurityIdentifier ("WD"); SecurityIdentifier userSid = new SecurityIdentifier ("SY"); security.SetGroup (groupSid); security.SetOwner (userSid); Assert.AreEqual ("G:WD", security.GetSecurityDescriptorSddlForm (AccessControlSections.Group)); Assert.AreEqual ("O:SY", security.GetSecurityDescriptorSddlForm (AccessControlSections.Owner)); security.SetSecurityDescriptorSddlForm ("O:BG", AccessControlSections.Owner); Assert.AreEqual ("O:BG", security.GetSecurityDescriptorSddlForm (AccessControlSections.Owner)); Assert.AreEqual (new SecurityIdentifier ("BG"), security.GetOwner (typeof (SecurityIdentifier))); }
public void SetSddlForm() { TestSecurity security = new TestSecurity(); SecurityIdentifier groupSid = new SecurityIdentifier("WD"); SecurityIdentifier userSid = new SecurityIdentifier("SY"); security.SetGroup(groupSid); security.SetOwner(userSid); Assert.AreEqual("G:WD", security.GetSecurityDescriptorSddlForm(AccessControlSections.Group)); Assert.AreEqual("O:SY", security.GetSecurityDescriptorSddlForm(AccessControlSections.Owner)); security.SetSecurityDescriptorSddlForm("O:BG", AccessControlSections.Owner); Assert.AreEqual("O:BG", security.GetSecurityDescriptorSddlForm(AccessControlSections.Owner)); Assert.AreEqual(new SecurityIdentifier("BG"), security.GetOwner(typeof(SecurityIdentifier))); }
public void SetGroupThrowsOnNull () { TestSecurity security = new TestSecurity (); security.SetGroup (null); }
public void SetGroupThrowsOnNull() { TestSecurity security = new TestSecurity(); security.SetGroup(null); }