public void Insert() { StatusBar bar = new StatusBar (); StatusBar.StatusBarPanelCollection collection = new StatusBar.StatusBarPanelCollection (bar); StatusBarPanel panel = new StatusBarPanel (); StatusBarPanel panel2 = new StatusBarPanel (); collection.Add (panel); Assert.AreEqual (1, collection.Count, "#1"); collection.Insert (0, panel); Assert.AreEqual (2, collection.Count, "#2"); }
public void AddRemoveTest () { StatusBar bar = new StatusBar (); StatusBar.StatusBarPanelCollection collection = new StatusBar.StatusBarPanelCollection (bar); StatusBarPanel panel = new StatusBarPanel (); StatusBarPanel panel2 = new StatusBarPanel (); collection.Add (panel); Assert.AreEqual (1, collection.Count, "#1"); collection.Remove (panel); Assert.AreEqual (0, collection.Count, "#2"); collection.Add (panel); collection.RemoveAt (0); Assert.AreEqual (0, collection.Count, "#3"); collection.Add (panel); Assert.AreEqual (0, collection.IndexOf (panel), "#4"); Assert.AreEqual (-1, collection.IndexOf (panel2), "#5"); collection.Add (panel2); Assert.AreEqual (1, collection.IndexOf (panel2), "#6"); collection.RemoveAt (0); Assert.AreEqual (0, collection.IndexOf (panel2), "#7"); Assert.AreEqual (1, collection.Count, "#8"); Assert.AreEqual (false, collection.Contains (panel), "#9"); Assert.AreEqual (true, collection.Contains (panel2), "#10"); }