Remove() public method

public Remove ( CodeNamespace value ) : void
value CodeNamespace
return void
コード例 #1
0
		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);
		}
コード例 #2
0
		public void Remove_Null ()
		{
			CodeNamespaceCollection coll = new CodeNamespaceCollection ();
			coll.Remove ((CodeNamespace) null);
		}
コード例 #3
0
		public void Remove_NotInCollection ()
		{
			CodeNamespaceCollection coll = new CodeNamespaceCollection ();
			coll.Remove (new CodeNamespace ());
		}
コード例 #4
0
		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");
		}