public void Default () { SmtpPermissionAttribute a = new SmtpPermissionAttribute (SecurityAction.Assert); Assert.AreEqual (a.ToString (), a.TypeId.ToString (), "TypeId"); Assert.IsFalse (a.Unrestricted, "Unrestricted"); Assert.IsNull (a.Access, "Access"); SmtpPermission perm = (SmtpPermission) a.CreatePermission (); Assert.IsFalse (a.Unrestricted, "Unrestricted"); }
public void Unrestricted () { SmtpPermissionAttribute a = new SmtpPermissionAttribute (SecurityAction.Assert); a.Unrestricted = true; SmtpPermission dp = (SmtpPermission) a.CreatePermission (); Assert.IsTrue (dp.IsUnrestricted (), "IsUnrestricted"); a.Unrestricted = false; dp = (SmtpPermission) a.CreatePermission (); Assert.IsFalse (dp.IsUnrestricted (), "!IsUnrestricted"); }
public void CreatePermission_Invalid () { SmtpPermissionAttribute a = new SmtpPermissionAttribute (SecurityAction.Assert); a.Access = String.Empty; Assert.AreEqual (0, a.Access.Length, "Empty"); Assert.IsNotNull (a.CreatePermission (), "Empty-Permission"); }