public void Default () { ServiceControllerPermissionAttribute a = new ServiceControllerPermissionAttribute (SecurityAction.Assert); Assert.AreEqual (a.ToString (), a.TypeId.ToString (), "TypeId"); Assert.IsFalse (a.Unrestricted, "Unrestricted"); Assert.AreEqual (".", a.MachineName, "MachineName"); Assert.AreEqual (ServiceControllerPermissionAccess.Browse, a.PermissionAccess, "PermissionAccess"); ServiceControllerPermission sp = (ServiceControllerPermission)a.CreatePermission (); Assert.IsFalse (sp.IsUnrestricted (), "IsUnrestricted"); }
public void Unrestricted () { ServiceControllerPermissionAttribute a = new ServiceControllerPermissionAttribute (SecurityAction.Assert); a.Unrestricted = true; ServiceControllerPermission wp = (ServiceControllerPermission)a.CreatePermission (); Assert.IsTrue (wp.IsUnrestricted (), "IsUnrestricted"); a.Unrestricted = false; wp = (ServiceControllerPermission)a.CreatePermission (); Assert.IsFalse (wp.IsUnrestricted (), "!IsUnrestricted"); }