public void TestInterfaceInstancianting() { TestList list = new TestList(); TestItem item1 = new TestItem("Anne"); TestItem item2 = new TestItem("Bob"); TestItem item3 = new TestItem("Charles"); IList <ITestItem> testList = list.GetList(); testList.Add(item1); list.AddItem(item2); list.AddTestItem(item3); Assert.AreEqual("TestItem: Anne", list.GetItem(0).Talk()); Assert.AreEqual("TestItem: Bob", list.GetItem(1).Talk()); Assert.AreEqual("TestItem: Charles", list.GetItem(2).Talk()); }
private void addItem() { testlist.AddItem("" + id); id++; }