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

            coll.AddRange(new List <Simple> {
                new Simple("d"), new Simple("e"), new Simple("f")
            });
            Assert.AreEqual(6, coll.Count);
            Assert.AreEqual("d", coll[3].Value);
            Assert.AreEqual("e", coll[4].Value);
            Assert.AreEqual("f", coll[5].Value);

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