Beispiel #1
0
        public void TestTrackableCollection_Insert(bool track)
        {
            var acc  = new Accumulator("test");
            var b    = new Simple("b");
            var c    = new Simple("c");
            var coll = new TrackableCollection <Simple>(acc, track)
            {
                new Simple("a"), b, new Simple("c")
            };

            coll.Insert(0, c);
            Assert.AreEqual(4, coll.Count);
            Assert.AreEqual(c, coll[0]);

            if (track)
            {
                Assert.AreEqual(4, acc.Records.Count);
            }
            else
            {
                Assert.AreEqual(0, acc.Records.Count);
            }
        }