Remove() public method

public Remove ( CodeCatchClause value ) : void
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 Remove_Null ()
		{
			CodeCatchClauseCollection coll = new CodeCatchClauseCollection ();
			coll.Remove ((CodeCatchClause) null);
		}
コード例 #3
0
		public void Remove_NotInCollection ()
		{
			CodeCatchClauseCollection coll = new CodeCatchClauseCollection ();
			coll.Remove (new CodeCatchClause ());
		}
コード例 #4
0
		public void Remove ()
		{
			CodeCatchClause ccc1 = new CodeCatchClause ();
			CodeCatchClause ccc2 = new CodeCatchClause ();

			CodeCatchClauseCollection coll = new CodeCatchClauseCollection ();
			coll.Add (ccc1);
			coll.Add (ccc2);
			Assert.AreEqual (2, coll.Count, "#1");
			Assert.AreEqual (0, coll.IndexOf (ccc1), "#2");
			Assert.AreEqual (1, coll.IndexOf (ccc2), "#3");
			coll.Remove (ccc1);
			Assert.AreEqual (1, coll.Count, "#4");
			Assert.AreEqual (-1, coll.IndexOf (ccc1), "#5");
			Assert.AreEqual (0, coll.IndexOf (ccc2), "#6");
		}