public void Constructor0_Deny_Unrestricted () { CodeTypeReferenceCollection coll = new CodeTypeReferenceCollection (); Assert.AreEqual (0, coll.Add (ctr), "Add"); Assert.AreSame (ctr, coll[0], "this[int]"); coll.CopyTo (array, 0); coll.AddRange (array); coll.AddRange (coll); Assert.IsTrue (coll.Contains (ctr), "Contains"); Assert.AreEqual (0, coll.IndexOf (ctr), "IndexOf"); coll.Insert (0, ctr); coll.Remove (ctr); }
public void Insert_Null () { CodeTypeReferenceCollection coll = new CodeTypeReferenceCollection (); coll.Insert (0, (CodeTypeReference) null); }
public void Insert () { CodeTypeReference ref1 = new CodeTypeReference (string.Empty); CodeTypeReference ref2 = new CodeTypeReference (string.Empty); CodeTypeReferenceCollection coll = new CodeTypeReferenceCollection (); coll.Add (ref1); Assert.AreEqual (1, coll.Count, "#1"); Assert.AreEqual (0, coll.IndexOf (ref1), "#2"); coll.Insert (0, ref2); Assert.AreEqual (2, coll.Count, "#3"); Assert.AreEqual (1, coll.IndexOf (ref1), "#4"); Assert.AreEqual (0, coll.IndexOf (ref2), "#5"); }