Insert() public method

public Insert ( int index, CodeCatchClause value ) : void
index int
value CodeCatchClause
return void
コード例 #1
0
		public void Constructor0_Deny_Unrestricted ()
		{
			CodeCatchClauseCollection coll = new CodeCatchClauseCollection ();
			Assert.AreEqual (0, coll.Add (ccc), "Add");
			Assert.AreSame (ccc, coll[0], "this[int]");
			coll.CopyTo (array, 0);
			coll.AddRange (array);
			coll.AddRange (coll);
			Assert.IsTrue (coll.Contains (ccc), "Contains");
			Assert.AreEqual (0, coll.IndexOf (ccc), "IndexOf");
			coll.Insert (0, ccc);
			coll.Remove (ccc);
		}
コード例 #2
0
		public void Insert_Null ()
		{
			CodeCatchClauseCollection coll = new CodeCatchClauseCollection ();
			coll.Insert (0, (CodeCatchClause) null);
		}
コード例 #3
0
		public void Insert ()
		{
			CodeCatchClause cc1 = new CodeCatchClause ();
			CodeCatchClause cc2 = new CodeCatchClause ();

			CodeCatchClauseCollection coll = new CodeCatchClauseCollection ();
			coll.Add (cc1);
			Assert.AreEqual (1, coll.Count, "#1");
			Assert.AreEqual (0, coll.IndexOf (cc1), "#2");
			coll.Insert (0, cc2);
			Assert.AreEqual (2, coll.Count, "#3");
			Assert.AreEqual (1, coll.IndexOf (cc1), "#4");
			Assert.AreEqual (0, coll.IndexOf (cc2), "#5");
		}