public AddRange ( |
||
value | ||
return | void |
public void Constructor1_Deny_Unrestricted () { CodeParameterDeclarationExpressionCollection coll = new CodeParameterDeclarationExpressionCollection (array); coll.CopyTo (array, 0); Assert.AreEqual (1, coll.Add (cpde), "Add"); Assert.AreSame (cpde, coll[0], "this[int]"); 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 AddRange_Self () { CodeParameterDeclarationExpressionCollection coll = new CodeParameterDeclarationExpressionCollection (); coll.Add (new CodeParameterDeclarationExpression ()); Assert.AreEqual (1, coll.Count, "#1"); coll.AddRange (coll); Assert.AreEqual (2, coll.Count, "#2"); }
public void AddRange_Null_Item () { CodeParameterDeclarationExpressionCollection coll = new CodeParameterDeclarationExpressionCollection (); coll.AddRange (new CodeParameterDeclarationExpression[] { null }); }
public void AddRange_Null_Collection () { CodeParameterDeclarationExpressionCollection coll = new CodeParameterDeclarationExpressionCollection (); coll.AddRange ((CodeParameterDeclarationExpressionCollection) null); }
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"); }