public void PermissionState_Unrestricted () { PermissionState ps = PermissionState.Unrestricted; ServiceControllerPermission scp = new ServiceControllerPermission (ps); Assert.AreEqual (0, scp.PermissionEntries.Count, "PermissionEntries"); Assert.IsTrue (scp.IsUnrestricted (), "IsUnrestricted"); SecurityElement se = scp.ToXml (); // only class and version are present Assert.AreEqual ("true", se.Attribute ("Unrestricted"), "Xml-Unrestricted"); Assert.IsNull (se.Children, "Xml-Children"); ServiceControllerPermission copy = (ServiceControllerPermission)scp.Copy (); Assert.IsFalse (Object.ReferenceEquals (scp, copy), "ReferenceEquals"); Assert.AreEqual (scp.PermissionEntries.Count, copy.PermissionEntries.Count, "copy-PermissionEntries"); Assert.AreEqual (scp.IsUnrestricted (), copy.IsUnrestricted (), "copy-IsUnrestricted ()"); }
public void PermissionState_Bad () { PermissionState ps = (PermissionState)77; ServiceControllerPermission scp = new ServiceControllerPermission (ps); Assert.IsFalse (scp.IsUnrestricted (), "IsUnrestricted"); }