public void IsDirty_NotDirty_Test() { SomeInt = new Property <PropertyHostMethodsTests, int>(this); var result = PropertyHostMethods.IsDirty(this); Assert.IsFalse(result); }
public void IsDirty_IsDirty_Test() { SomeInt = new Property <PropertyHostMethodsTests, int>(this); SomeInt.Value += 1; var result = PropertyHostMethods.IsDirty(this); Assert.IsTrue(result); }
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); }
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); }
public PropertyTests() { //this really is the first test PropertyHostMethods.InitializeProperties(this); }
/// <summary> /// Calls PropertyHostMethods.InitializeProperties so you don't have to /// </summary> public PropertyHost() { PropertyHostMethods.InitializeProperties(this); }
/// <summary> /// Uses reflection to find all Properties and mark them as clean (call Property.MarkAsClean()) /// </summary> public void MarkAsClean() { PropertyHostMethods.MarkAsClean(this); }