public void Constructor0_Deny_Unrestricted () { CodeNamespaceCollection coll = new CodeNamespaceCollection (); Assert.AreEqual (0, coll.Add (cn), "Add"); Assert.AreSame (cn, coll[0], "this[int]"); coll.CopyTo (array, 0); coll.AddRange (array); coll.AddRange (coll); Assert.IsTrue (coll.Contains (cn), "Contains"); Assert.AreEqual (0, coll.IndexOf (cn), "IndexOf"); coll.Insert (0, cn); coll.Remove (cn); }
public void Remove_Null () { CodeNamespaceCollection coll = new CodeNamespaceCollection (); coll.Remove ((CodeNamespace) null); }
public void Remove_NotInCollection () { CodeNamespaceCollection coll = new CodeNamespaceCollection (); coll.Remove (new CodeNamespace ()); }
public void Remove () { CodeNamespace cns1 = new CodeNamespace (); CodeNamespace cns2 = new CodeNamespace (); CodeNamespaceCollection coll = new CodeNamespaceCollection (); coll.Add (cns1); coll.Add (cns2); Assert.AreEqual (2, coll.Count, "#1"); Assert.AreEqual (0, coll.IndexOf (cns1), "#2"); Assert.AreEqual (1, coll.IndexOf (cns2), "#3"); coll.Remove (cns1); Assert.AreEqual (1, coll.Count, "#4"); Assert.AreEqual (-1, coll.IndexOf (cns1), "#5"); Assert.AreEqual (0, coll.IndexOf (cns2), "#6"); }