Exemple #1
0
        public void FromXml_NonBooleanLookAtDir()
        {
            ApplicationMembershipCondition app = new ApplicationMembershipCondition();
            SecurityElement se = app.ToXml();

            SecurityElement w = new SecurityElement(se.Tag);

            w.AddAttribute("class", se.Attribute("class"));
            w.AddAttribute("version", se.Attribute("version"));
            w.AddAttribute("LookAtDir", "Maybe");              // not (generally) a boolean ;)

            ApplicationMembershipCondition app2 = new ApplicationMembershipCondition();

            app2.FromXml(w);

            se = app2.ToXml();
            Assert.IsNull(se.Attribute("LookAtDir"), "LookAtDir");
            // LookAtDir isn't part of the Equals computation
            Assert.IsTrue(app2.Equals(app), "Equals-1");
            Assert.IsTrue(app.Equals(app2), "Equals-2");

            ApplicationMembershipCondition app3 = (ApplicationMembershipCondition)app2.Copy();

            se = app3.ToXml();
            // LookAtDir isn't copied either
            Assert.AreEqual("true", se.Attribute("LookAtDir"), "Copy-LookAtDir");
        }
Exemple #2
0
        public void Copy()
        {
            ApplicationMembershipCondition app  = new ApplicationMembershipCondition();
            ApplicationMembershipCondition copy = (ApplicationMembershipCondition)app.Copy();

            Assert.AreEqual(app, copy, "Equals");
            Assert.IsFalse(Object.ReferenceEquals(app, copy), "ReferenceEquals");
        }
Exemple #3
0
        public void GetHashCode_()
        {
            ApplicationMembershipCondition app = new ApplicationMembershipCondition();

            Assert.AreEqual(-1, app.GetHashCode());
            ApplicationMembershipCondition copy = (ApplicationMembershipCondition)app.Copy();

            Assert.AreEqual(app.GetHashCode(), copy.GetHashCode());
        }