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));
 }
Exemple #3
0
        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);
        }
Exemple #4
0
        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));
        }