Exemplo n.º 1
0
        public void TestReturnDefaultValue()
        {
            AdkProperties props = new AdkProperties( null );
            props["TEST1"] = "Value1";

            Assert.AreEqual( "Value1", props["TEST1"] );
            Assert.AreEqual("Value1", props.GetProperty( "TEST1" ));
            Assert.AreEqual("Value1", props.GetProperty( "TEST1", "foo" ));
            Assert.AreEqual("foo", props.GetProperty( "bar", "foo" ));
        }
Exemplo n.º 2
0
        public void TestReturnDefaultValueWithInheritance()
        {
            AdkProperties parent = new AdkProperties(null);
            parent["TEST1"] = "Value1";

            AdkProperties props = new AdkProperties( parent );
            props["TEST2"] = "Value2";

            Assert.AreEqual("Value1", props["TEST1"]);
            Assert.AreEqual("Value2", props["TEST2"]);
            Assert.AreEqual("Value1", props.GetProperty("TEST1"));
            Assert.AreEqual("Value1", props.GetProperty("TEST1", "foo"));
            Assert.AreEqual("foo", props.GetProperty("bar", "foo"));

            props["TEST1"] = "scooter";
            Assert.AreEqual("scooter", props["TEST1"]);
        }
Exemplo n.º 3
0
 /// <summary>  Creates a properties object that inherits values from a parent</summary>
 /// <param name="inherit">The parent AdkProperties object
 /// </param>
 public AdkProperties( AdkProperties inherit )
 {
     fParent = inherit;
 }
Exemplo n.º 4
0
 /// <summary>  Creates a properties object that inherits values from a parent</summary>
 /// <param name="inherit">The parent AdkProperties object
 /// </param>
 public AdkProperties(AdkProperties inherit)
 {
     fParent = inherit;
 }