public static void DataProtectionPermissionAttributeCallMethods() { var dpa = new DataProtectionPermissionAttribute(new SecurityAction()); DataProtectionPermissionFlags flags = dpa.Flags; bool protectData = dpa.ProtectData; bool unprotectData = dpa.UnprotectData; bool protectMemory = dpa.ProtectMemory; bool unprotectMemory = dpa.UnprotectMemory; IPermission ip = dpa.CreatePermission(); }
public void Unrestricted() { DataProtectionPermissionAttribute a = Empty(); a.Unrestricted = true; Assert.AreEqual(DataProtectionPermissionFlags.NoFlags, a.Flags, "Unrestricted"); DataProtectionPermission perm = (DataProtectionPermission)a.CreatePermission(); Assert.AreEqual(DataProtectionPermissionFlags.AllFlags, perm.Flags, "CreatePermission.Flags"); }
public void Default() { DataProtectionPermissionAttribute a = new DataProtectionPermissionAttribute(SecurityAction.Assert); Assert.IsFalse(a.ProtectData, "ProtectData"); Assert.IsFalse(a.UnprotectData, "UnprotectData"); Assert.IsFalse(a.ProtectMemory, "ProtectMemory"); Assert.IsFalse(a.UnprotectMemory, "UnprotectMemory"); Assert.IsFalse(a.Unrestricted, "Unrestricted"); Assert.AreEqual(DataProtectionPermissionFlags.NoFlags, a.Flags, "Flags"); Assert.AreEqual(a.ToString(), a.TypeId.ToString(), "TypeId"); DataProtectionPermission perm = (DataProtectionPermission)a.CreatePermission(); Assert.AreEqual(DataProtectionPermissionFlags.NoFlags, perm.Flags, "CreatePermission.Flags"); }