public void InsertRangeTest() { var a = new[] { new EClass(1), new EClass(2) }; var l = new EventedList <EClass>(a); l.InsertRange(1, a); Assert.That(l.Count, Is.EqualTo(4)); Assert.That(l[1].Prop, Is.EqualTo(1)); Assert.That(l[2].Prop, Is.EqualTo(2)); }
public void TestInsertRange() { Init(); m_uut.AddRange(new string[] { "Bob", "Mary", "Tim" }); m_uut.InsertRange(1, new string[] { "Paul", "Randy", "Sara" }); Assert.IsTrue(m_uut[0].Equals("Bob")); Assert.IsTrue(m_uut[1].Equals("Paul")); Assert.IsTrue(m_uut[2].Equals("Randy")); Assert.IsTrue(m_uut[3].Equals("Sara")); Assert.IsTrue(m_uut[4].Equals("Mary")); Assert.IsTrue(m_uut[5].Equals("Tim")); Assert.IsTrue(m_responses.Equals("m_uut_AboutToAddItems System.String[] | m_uut_AddedItems System.String[] | m_uut_ContentsChanged | m_uut_AboutToAddItems System.String[] | m_uut_AddedItems System.String[] | m_uut_ContentsChanged | ")); Console.WriteLine(m_responses); }