コード例 #1
0
ファイル: LangElement.cs プロジェクト: danieladacruz/Parsers
 void IPropertyCollection.ClearProperties()
 {
     lock (this)
     {
         _properties.ClearProperties();
     }
 }
コード例 #2
0
 public void ClearProperties()
 {
     lock (this)
     {
         _properties.ClearProperties();
     }
 }
コード例 #3
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); 
            }
        }
コード例 #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
ファイル: LangElement.cs プロジェクト: ruo2012/peachpie
 void IPropertyCollection.ClearProperties()
 {
     _properties.ClearProperties();
 }