示例#1
0
 void IPropertyCollection.ClearProperties()
 {
     lock (this)
     {
         _properties.ClearProperties();
     }
 }
示例#2
0
 public void ClearProperties()
 {
     lock (this)
     {
         _properties.ClearProperties();
     }
 }
        public void PropertyCollectionTest()
        {
            var collection = new PropertyCollection();

            for (int pass = 1; pass < 100; pass++)
            {
                collection.ClearProperties();
                Assert.AreEqual(collection.Count, 0);

                int count = pass * 2;

                TestAdd(ref collection, count);
                Assert.AreEqual(collection.Count, count);

                TestRemove(ref collection, count);
                Assert.AreEqual(collection.Count, 0);

                TestAdd(ref collection, count);
                Assert.AreEqual(collection.Count, count);

                // delete every second property
                for (int i = 0; i < count; i+=2)
                {
                    collection.RemoveProperty(i);
                    Assert.AreEqual(collection.GetProperty(i), null);
                }
                Assert.AreEqual(collection.Count, count / 2);

                // test property replacement
                for (int i = 1; i < count; i += 2)
                {
                    collection.SetProperty(i, i * 2);
                    Assert.AreEqual(collection.GetProperty(i), i * 2);
                }
                Assert.AreEqual(collection.Count, count / 2); 
            }
        }
示例#4
0
        public void PropertyCollectionTest()
        {
            var collection = new PropertyCollection();

            for (int pass = 1; pass < 100; pass++)
            {
                collection.ClearProperties();
                Assert.AreEqual(collection.Count, 0);

                int count = pass * 2;

                TestAdd(ref collection, count);
                Assert.AreEqual(collection.Count, count);

                TestRemove(ref collection, count);
                Assert.AreEqual(collection.Count, 0);

                TestAdd(ref collection, count);
                Assert.AreEqual(collection.Count, count);

                // delete every second property
                for (int i = 0; i < count; i += 2)
                {
                    collection.RemoveProperty(i);
                    Assert.AreEqual(collection.GetProperty(i), null);
                }
                Assert.AreEqual(collection.Count, count / 2);

                // test property replacement
                for (int i = 1; i < count; i += 2)
                {
                    collection.SetProperty(i, i * 2);
                    Assert.AreEqual(collection.GetProperty(i), i * 2);
                }
                Assert.AreEqual(collection.Count, count / 2);
            }
        }
示例#5
0
 void IPropertyCollection.ClearProperties()
 {
     _properties.ClearProperties();
 }