Remove() public method

public Remove ( CodeStatement value ) : void
value CodeStatement
return void
コード例 #1
0
		public void Constructor0_Deny_Unrestricted ()
		{
			CodeStatementCollection coll = new CodeStatementCollection ();
			Assert.AreEqual (0, coll.Add (cs), "Add");
			Assert.AreSame (cs, coll[0], "this[int]");
			coll.CopyTo (array, 0);
			coll.AddRange (array);
			coll.AddRange (coll);
			Assert.IsTrue (coll.Contains (cs), "Contains");
			Assert.AreEqual (0, coll.IndexOf (cs), "IndexOf");
			coll.Insert (0, cs);
			coll.Remove (cs);
		}
コード例 #2
0
		public void Remove_NotInCollection ()
		{
			CodeStatementCollection coll = new CodeStatementCollection ();
			coll.Remove (new CodeStatement ());
		}
コード例 #3
0
		public void Remove_Null ()
		{
			CodeStatementCollection coll = new CodeStatementCollection ();
			coll.Remove ((CodeStatement) null);
		}
コード例 #4
0
		public void Remove ()
		{
			CodeStatement cs1 = new CodeStatement ();
			CodeStatement cs2 = new CodeStatement ();

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