Пример #1
0
        public void ToXml_Unrestricted()
        {
            NamedPermissionSet ps = new NamedPermissionSet(name, PermissionState.Unrestricted);
            SecurityElement    se = ps.ToXml();

            Assert.IsTrue(ps.ToString().StartsWith("<PermissionSet"), "Unrestricted.ToString().StartsWith");
            Assert.AreEqual("System.Security.NamedPermissionSet", (se.Attributes ["class"] as string), "Unrestricted.class");
            Assert.AreEqual("1", (se.Attributes ["version"] as string), "Unrestricted.version");
            Assert.AreEqual(name, (se.Attributes ["Name"] as string), "Unrestricted.Name");
            Assert.IsNull((se.Attributes ["Description"] as string), "Unrestricted.Description");
            Assert.AreEqual("true", (se.Attributes ["Unrestricted"] as string), "Unrestricted.Unrestricted");
        }