GetPropertyBag() public méthode

public GetPropertyBag ( ) : PropertyBag
Résultat Tortuga.Anchor.Modeling.Internals.PropertyBag
Exemple #1
0
        public void PropertyBag_IsDefinedTest()
        {
            var person = new SimplePerson();
            var bag = person.GetPropertyBag();
            Assert.IsFalse(bag.IsDefined("FirstName"));
            Assert.IsFalse(bag.IsDefined("FullName"));
            Assert.IsFalse(bag.IsDefined("Frank"));

            person.FirstName = "Tom";
            Assert.IsTrue(bag.IsDefined("FirstName"));
            Assert.IsFalse(bag.IsDefined("FullName"));
            Assert.IsFalse(bag.IsDefined("Frank"));
        }
Exemple #2
0
        public void PropertyBag_FixCasingTest()
        {
            var person = new SimplePerson();
            var bag = person.GetPropertyBag();

            person.FirstName = "Frank";
            person.FirstName = "Frank";
            bag.Set("Tom", PropertySetModes.FixCasing, "firstname");
            Assert.AreEqual("Tom", person.FirstName);
        }