IndexOf() public method

public IndexOf ( CodeParameterDeclarationExpression value ) : int
value CodeParameterDeclarationExpression
return int
		public void Constructor1 ()
		{
			CodeParameterDeclarationExpression param1 = new CodeParameterDeclarationExpression ();
			CodeParameterDeclarationExpression param2 = new CodeParameterDeclarationExpression ();

			CodeParameterDeclarationExpression[] parameters = new CodeParameterDeclarationExpression[] { param1, param2 };
			CodeParameterDeclarationExpressionCollection coll = new CodeParameterDeclarationExpressionCollection (
				parameters);

			Assert.AreEqual (2, coll.Count, "#1");
			Assert.AreEqual (0, coll.IndexOf (param1), "#2");
			Assert.AreEqual (1, coll.IndexOf (param2), "#3");
		}
		public void Constructor0_Deny_Unrestricted ()
		{
			CodeParameterDeclarationExpressionCollection coll = new CodeParameterDeclarationExpressionCollection ();
			Assert.AreEqual (0, coll.Add (cpde), "Add");
			Assert.AreSame (cpde, coll[0], "this[int]");
			coll.CopyTo (array, 0);
			coll.AddRange (array);
			coll.AddRange (coll);
			Assert.IsTrue (coll.Contains (cpde), "Contains");
			Assert.AreEqual (0, coll.IndexOf (cpde), "IndexOf");
			coll.Insert (0, cpde);
			coll.Remove (cpde);
		}
		public void Constructor2 ()
		{
			CodeParameterDeclarationExpression param1 = new CodeParameterDeclarationExpression ();
			CodeParameterDeclarationExpression param2 = new CodeParameterDeclarationExpression ();

			CodeParameterDeclarationExpressionCollection c = new CodeParameterDeclarationExpressionCollection ();
			c.Add (param1);
			c.Add (param2);

			CodeParameterDeclarationExpressionCollection coll = new CodeParameterDeclarationExpressionCollection (c);
			Assert.AreEqual (2, coll.Count, "#1");
			Assert.AreEqual (0, coll.IndexOf (param1), "#2");
			Assert.AreEqual (1, coll.IndexOf (param2), "#3");
		}
		public void Remove ()
		{
			CodeParameterDeclarationExpression cpde1 = new CodeParameterDeclarationExpression ();
			CodeParameterDeclarationExpression cpde2 = new CodeParameterDeclarationExpression ();

			CodeParameterDeclarationExpressionCollection coll = new CodeParameterDeclarationExpressionCollection ();
			coll.Add (cpde1);
			coll.Add (cpde2);
			Assert.AreEqual (2, coll.Count, "#1");
			Assert.AreEqual (0, coll.IndexOf (cpde1), "#2");
			Assert.AreEqual (1, coll.IndexOf (cpde2), "#3");
			coll.Remove (cpde1);
			Assert.AreEqual (1, coll.Count, "#4");
			Assert.AreEqual (-1, coll.IndexOf (cpde1), "#5");
			Assert.AreEqual (0, coll.IndexOf (cpde2), "#6");
		}
		public void AddRange ()
		{
			CodeParameterDeclarationExpression param1 = new CodeParameterDeclarationExpression ();
			CodeParameterDeclarationExpression param2 = new CodeParameterDeclarationExpression ();
			CodeParameterDeclarationExpression param3 = new CodeParameterDeclarationExpression ();

			CodeParameterDeclarationExpressionCollection coll1 = new CodeParameterDeclarationExpressionCollection ();
			coll1.Add (param1);
			coll1.Add (param2);

			CodeParameterDeclarationExpressionCollection coll2 = new CodeParameterDeclarationExpressionCollection ();
			coll2.Add (param3);
			coll2.AddRange (coll1);
			Assert.AreEqual (3, coll2.Count, "#1");
			Assert.AreEqual (1, coll2.IndexOf (param1), "#2");
			Assert.AreEqual (2, coll2.IndexOf (param2), "#3");
			Assert.AreEqual (0, coll2.IndexOf (param3), "#4");

			CodeParameterDeclarationExpressionCollection coll3 = new CodeParameterDeclarationExpressionCollection ();
			coll3.Add (param3);
			coll3.AddRange (new CodeParameterDeclarationExpression[] { param1, param2 });
			Assert.AreEqual (3, coll2.Count, "#5");
			Assert.AreEqual (1, coll2.IndexOf (param1), "#6");
			Assert.AreEqual (2, coll2.IndexOf (param2), "#7");
			Assert.AreEqual (0, coll2.IndexOf (param3), "#8");
		}
		public void Insert ()
		{
			CodeParameterDeclarationExpression param1 = new CodeParameterDeclarationExpression ();
			CodeParameterDeclarationExpression param2 = new CodeParameterDeclarationExpression ();

			CodeParameterDeclarationExpressionCollection coll = new CodeParameterDeclarationExpressionCollection ();
			coll.Add (param1);
			Assert.AreEqual (1, coll.Count, "#1");
			Assert.AreEqual (0, coll.IndexOf (param1), "#2");
			coll.Insert (0, param2);
			Assert.AreEqual (2, coll.Count, "#3");
			Assert.AreEqual (1, coll.IndexOf (param1), "#4");
			Assert.AreEqual (0, coll.IndexOf (param2), "#5");
		}