예제 #1
0
        /// <summary>
        /// Initializes the lists.
        /// </summary>
        private void InitLists()
        {
            if (AlphaList == null)
            {
                AlphaList = new List <int>();
            }
            else
            {
                AlphaList.Clear();
            }

            if (BetaList == null)
            {
                BetaList = new List <int>();
            }
            else
            {
                BetaList.Clear();
            }

            if (AList == null)
            {
                AList = new List <int>();
            }
            else
            {
                AList.Clear();
            }

            if (BList == null)
            {
                BList = new List <int>();
            }
            else
            {
                BList.Clear();
            }
        }
예제 #2
0
        public void given_blist_when_clear_is_called_then_collectionchanged_raised()
        {
            var blist = new BList<int>();

            blist.AddRange(new int[32].Select(_ => _random.Next()).ToArray());

            NotifyCollectionChangedEventArgs args = null;
            blist.CollectionChanged += (_, a) => args = a;

            blist.Clear();

            Assert.That(args, Is.Not.Null);
            Assert.That(args.Action, Is.EqualTo(NotifyCollectionChangedAction.Reset));
        }