public void CopyPropertiesToCopiesValues() { var store = new AttachablePropertyStoreTest(); var identifier = new AttachableMemberIdentifier( typeof(AttachablePropertyStoreTest), "Test"); store.SetProperty(identifier, 123); var array = new KeyValuePair<AttachableMemberIdentifier, object>[1]; store.CopyPropertiesTo(array, 0); Assert.AreSame(identifier, array[0].Key); }
public void RemovePropertyAddsAProperty() { var store = new AttachablePropertyStoreTest(); var identifier = new AttachableMemberIdentifier( typeof(AttachablePropertyStoreTest), "Test"); store.SetProperty(identifier, 123); Assert.IsTrue(store.RemoveProperty(identifier)); Assert.AreEqual(0, store.PropertyCount); object value; Assert.IsFalse(store.TryGetProperty(identifier, out value)); }
public void CopyPropertiesToCopiesValues() { var store = new AttachablePropertyStoreTest(); var identifier = new AttachableMemberIdentifier( typeof(AttachablePropertyStoreTest), "Test"); store.SetProperty(identifier, 123); var array = new KeyValuePair <AttachableMemberIdentifier, object> [1]; store.CopyPropertiesTo(array, 0); Assert.AreSame(identifier, array[0].Key); }