예제 #1
0
        public void RemoveTest()
        {
            StyleItemCollection target = GetStdCollection();
            StyleItemBase       item   = target[StyleKeys.BgItemKey]; //Assume there is more than one item
            bool expected = true;
            bool actual   = target.Remove(item);

            Assert.AreEqual(expected, actual);
            Assert.AreEqual(StdCollectionCount - 1, target.Count);
            Assert.IsFalse(target.Contains(item));
        }
예제 #2
0
        public void CopyToTest()
        {
            int offset = 2;
            StyleItemCollection target = GetStdCollection();

            StyleItemBase[] array = new StyleItemBase[StdCollectionCount + offset];

            int arrayIndex = offset;

            target.CopyTo(array, arrayIndex);

            for (int i = 0; i < StdCollectionCount + offset; i++)
            {
                if (i < offset)
                {
                    Assert.IsNull(array[i]);
                }
                else
                {
                    Assert.IsNotNull(array[i]);
                }
            }
        }