Example #1
0
        public void IsDirty_NotDirty_Test()
        {
            SomeInt = new Property <PropertyHostMethodsTests, int>(this);
            var result = PropertyHostMethods.IsDirty(this);

            Assert.IsFalse(result);
        }
Example #2
0
        public void IsDirty_IsDirty_Test()
        {
            SomeInt        = new Property <PropertyHostMethodsTests, int>(this);
            SomeInt.Value += 1;
            var result = PropertyHostMethods.IsDirty(this);

            Assert.IsTrue(result);
        }
Example #3
0
        public void MarkAsClean_Test()
        {
            SomeInt        = new Property <PropertyHostMethodsTests, int>(this);
            SomeInt.Value += 1;
            var result = PropertyHostMethods.IsDirty(this);

            Assert.IsTrue(result);

            PropertyHostMethods.MarkAsClean(this);
            result = PropertyHostMethods.IsDirty(this);
            Assert.IsFalse(result);
        }
Example #4
0
        public void InitializeProperties_Test()
        {
            SomeInt = new Property <PropertyHostMethodsTests, int>((owner, oldValue, newValue) =>
            {
                _host = owner as PropertyHostMethodsTests;
            });

            //find all owned properties (SomeInt) and set the Owner to this
            PropertyHostMethods.InitializeProperties(this);

            SomeInt.Value++;
            Assert.IsTrue(_host == this);
        }
Example #5
0
 public PropertyTests()
 {
     //this really is the first test
     PropertyHostMethods.InitializeProperties(this);
 }
Example #6
0
 /// <summary>
 /// Calls PropertyHostMethods.InitializeProperties so you don't have to
 /// </summary>
 public PropertyHost()
 {
     PropertyHostMethods.InitializeProperties(this);
 }
Example #7
0
 /// <summary>
 /// Uses reflection to find all Properties and mark them as clean (call Property.MarkAsClean())
 /// </summary>
 public void MarkAsClean()
 {
     PropertyHostMethods.MarkAsClean(this);
 }