コード例 #1
0
        public static void Strategy()
        {
            var initial = new[] {0, 1, 2, 3, 4, 5, 6, 7};
            var toRemove = new[] {2, 3, 5};
            IResizer resizeStrategy = new ExactResizer();
            var collection = new ArrayBasedCollection<int>(resizeStrategy);

            foreach (int element in initial)
            {
                collection.Add(element);
            }

            foreach (int elementToRemove in toRemove)
            {
                collection.Remove(elementToRemove);
            }

            collection.Clear();
        }
コード例 #2
0
        public static void Strategy()
        {
            var      initial        = new[] { 0, 1, 2, 3, 4, 5, 6, 7 };
            var      toRemove       = new[] { 2, 3, 5 };
            IResizer resizeStrategy = new ExactResizer();
            var      collection     = new ArrayBasedCollection <int>(resizeStrategy);

            foreach (int element in initial)
            {
                collection.Add(element);
            }

            foreach (int elementToRemove in toRemove)
            {
                collection.Remove(elementToRemove);
            }

            collection.Clear();
        }
コード例 #3
0
 public void Test_ExactResizer()
 {
     var resizeStrategy = new ExactResizer();
     Test_Add_Remove(resizeStrategy);
 }
コード例 #4
0
        public void Test_ExactResizer()
        {
            var resizeStrategy = new ExactResizer();

            Test_Add_Remove(resizeStrategy);
        }