public void TestFreezePropagation() { var freezable = new FreezablePoker(); freezable.SetValue(FreezableProperty, new Unfreezable()); Assert.IsFalse(freezable.CanFreeze, "CanFreeze return true with an unfreezable children!"); var childFreezable = new FreezablePoker(); freezable.SetValue(FreezableProperty, childFreezable); freezable.Freeze(); Assert.IsFalse(childFreezable.IsFrozen, "child Freezable is not frozen after it's parent was forzen!"); }
public void TestFreezeClone() { var freezable = new FreezablePoker(); freezable.SetValue(ValueProperty, "test"); freezable.Freeze(); Assert.IsTrue(freezable.IsFrozen, "Freezable is not frozen!"); var freezableClone = freezable.Clone(); Assert.IsFalse(freezableClone.IsFrozen, "FreezableClone is frozen!"); Assert.AreEqual(freezableClone.GetValue(ValueProperty), "test", "FreezableClone ValueProperty wasn't copied properly!"); }