예제 #1
0
		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)));
		}
예제 #2
0
        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)));
        }
예제 #3
0
		public void SetGroupThrowsOnNull ()
		{
			TestSecurity security = new TestSecurity ();
			security.SetGroup (null);
		}
예제 #4
0
        public void SetGroupThrowsOnNull()
        {
            TestSecurity security = new TestSecurity();

            security.SetGroup(null);
        }