Example #1
0
 public void ShouldUpdateBool()
 {
     // TODO: AAA
     mod1 = new LooseModel(PropBagTypeSafetyMode.None, _amHelpers.StoreAccessCreator, _amHelpers.PropFactory_V1)
     {
         PropBool = true
     };
     Assert.That(mod1.PropBool, Is.True, "PropBool did not get updated.");
 }
Example #2
0
        public void ShouldGetArgumentNullEx()
        {
            // TODO: AAA
            mod1 = new LooseModel(PropBagTypeSafetyMode.None, _amHelpers.StoreAccessCreator, _amHelpers.PropFactory_V1);

            object x;

            Assert.Throws <ArgumentNullException>(() => x = mod1["System.String", null]);
        }
Example #3
0
        public void ShouldGetKeyNotFoundEx()
        {
            // TODO: AAA
            mod1 = new LooseModel(PropBagTypeSafetyMode.None, _amHelpers.StoreAccessCreator, _amHelpers.PropFactory_V1);

            object x;

            Assert.Throws <InvalidOperationException>(() => x = mod1["System.String", "x"]);
        }
Example #4
0
        public void ShouldSAndGLooseUseNew1stNullNotOk()
        {
            // TODO: AAA
            mod1 = new LooseModel(PropBagTypeSafetyMode.None, _amHelpers.StoreAccessCreator, _amHelpers.PropFactory_V1);

            mod1[typeof(object), PROP_NEW] = 0;
            Assert.That(mod1.GetTypeOfProperty(PROP_NEW), Is.EqualTo(typeof(object)));

            Assert.Throws <InvalidOperationException>(() => mod1[typeof(string), PROP_NEW] = "0");
        }
Example #5
0
        public void ShouldSAndGLooseUseNewProp()
        {
            // TODO: AAA
            mod1 = new LooseModel(PropBagTypeSafetyMode.None, _amHelpers.StoreAccessCreator, _amHelpers.PropFactory_V1);

            mod1["System.String", PROP_NEW] = "string";

            string s     = (string)mod1["System.String", PROP_NEW];
            Type   vType = mod1.GetTypeOfProperty(PROP_NEW);

            Assert.That(s, Is.EqualTo("string"));
            Assert.That(vType, Is.EqualTo(typeof(string)));
        }
Example #6
0
        public void ShouldSAndGLooseBool()
        {
            // TODO: AAA
            mod1 = new LooseModel(PropBagTypeSafetyMode.None, _amHelpers.StoreAccessCreator, _amHelpers.PropFactory_V1)
            {
                PropBool = true
            };

            bool temp = mod1.PropBool;

            Assert.That(temp, Is.EqualTo(true));
            //Assert.That(PropStringChangeWasCalled, Is.EqualTo(true), "PropStringChangeWasCalled = false");
        }
Example #7
0
        public void UpdateViaPropGenAccess()
        {
            // TODO: AAA
            mod1 = new LooseModel(PropBagTypeSafetyMode.None, _amHelpers.StoreAccessCreator, _amHelpers.PropFactory_V1);

            IPropData pg = mod1.GetPropGen("PropBool");

            IProp <bool> pt = (IProp <bool>)pg.TypedProp;

            //pt.Value = false;

            //pt.Value = true;
        }
Example #8
0
        public void ShouldUpdateString()
        {
            // TODO: AAA
            mod1 = new LooseModel(PropBagTypeSafetyMode.None, _amHelpers.StoreAccessCreator, _amHelpers.PropFactory_V1);

            mod1.PropStringChanged += Mod1_PropStringChanged;


            mod1.PropString = "Test2";

            string temp = mod1.PropString;

            // Added this statement on 11/9/2017.
            mod1.PropStringChanged -= Mod1_PropStringChanged;

            Assert.That(temp, Is.EqualTo("Test2"));
            Assert.That(mod1.PropString, Is.EqualTo("Test2"));
            Assert.That(propString_WasUpdated, Is.EqualTo(true), "PropStringChangeWasCalled = false");
        }
Example #9
0
 public void Destroy()
 {
     mod1 = null;
 }