Exemplo n.º 1
0
        public void PropertyBag_AddPropertyTwice()
        {
            var          target     = new PageInfo();
            const string propName   = "myProp";
            const string propValue1 = "myPropValue1";
            const string propValue2 = "myPropValue2";

            target.AddProperty(propName, propValue1);
            Assert.Equal(1, target.PropertyBag.Count);
            Assert.Equal(propValue1, target.PropertyBag[propName]);
            target.AddProperty(propName, propValue2);
            Assert.Equal(1, target.PropertyBag.Count);              // still only one property
            Assert.Equal(propValue2, target.PropertyBag[propName]); // but with different value now
        }
Exemplo n.º 2
0
        public void PropertyBag_CustomValues()
        {
            var          target    = new PageInfo();
            const string propName  = "myProp";
            const string propValue = "myPropValue";

            target.AddProperty(propName, propValue);
            Assert.Equal(1, target.PropertyBag.Count);
            Assert.Equal(propValue, target.PropertyBag[propName]);
            Assert.Equal(propValue, target.GetProperty(propName));
        }