public void AttachTest() { var testAttachedObject = new TestAttachedObject(); testAttachedObject.Attach(testDependencyObject); Assert.AreEqual(testAttachedObject.AssociatedObject, testDependencyObject); testAttachedObject.Attach(testDependencyObject); // for code coverage Assert.ThrowsException <InvalidOperationException>(() => testAttachedObject.Attach(null)); testAttachedObject.Clone(); // for code coverage }
public void DetachTest() { var testAttachedObject = new TestAttachedObject(); testAttachedObject.Attach(testDependencyObject); testAttachedObject.Detach(); Assert.IsNull(testAttachedObject.AssociatedObject); }