public static void SiteMembershipConditionCallMethods()
        {
            SiteMembershipCondition smc = new SiteMembershipCondition("test");
            bool check = smc.Check(new Evidence());
            IMembershipCondition obj = smc.Copy();

            check = smc.Equals(new object());
            int             hash = smc.GetHashCode();
            string          str  = smc.ToString();
            SecurityElement se   = new SecurityElement("");
            PolicyLevel     pl   = (PolicyLevel)FormatterServices.GetUninitializedObject(typeof(PolicyLevel));

            smc.FromXml(se);
            smc.FromXml(se, pl);
            se = smc.ToXml();
            se = smc.ToXml(pl);
        }
Ejemplo n.º 2
0
        public static void SiteMembershipConditionCallMethods()
        {
            SiteMembershipCondition smc = new SiteMembershipCondition("test");
            bool check = smc.Check(new Evidence());
            IMembershipCondition obj = smc.Copy();

            check = smc.Equals(new object());
            int             hash = smc.GetHashCode();
            string          str  = smc.ToString();
            SecurityElement se   = new SecurityElement("");
            PolicyLevel     pl   = (PolicyLevel)Activator.CreateInstance(typeof(PolicyLevel), true);

            smc.FromXml(se);
            smc.FromXml(se, pl);
            se = smc.ToXml();
            se = smc.ToXml(pl);
        }
Ejemplo n.º 3
0
        public void Site_AllGoMonoSite()
        {
            SiteMembershipCondition smc = new SiteMembershipCondition("*.go-mono.com");

            Assert.AreEqual("*.go-mono.com", smc.Site, "Site");
            Assert.AreEqual("Site - *.go-mono.com", smc.ToString(), "ToString");

            SiteMembershipCondition smc2 = (SiteMembershipCondition)smc.Copy();

            Assert.AreEqual(smc.Site, smc2.Site, "Copy.Site");
            Assert.AreEqual(smc.GetHashCode(), smc2.GetHashCode(), "Copy.GetHashCode");

            SecurityElement         se   = smc2.ToXml();
            SiteMembershipCondition smc3 = new SiteMembershipCondition("*");

            smc3.FromXml(se);
            Assert.AreEqual(smc.Site, smc3.Site, "ToXml/FromXml");

            Assert.IsTrue(smc.Equals(smc2), "Equals");
            SiteMembershipCondition smc4 = new SiteMembershipCondition("go-mono.com");

            Assert.IsFalse(smc.Equals(smc4), "!Equals");
        }