Insert() публичный Метод

public Insert ( int index, CodeNamespace value ) : void
index int
value CodeNamespace
Результат 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 Insert_Null ()
		{
			CodeNamespaceCollection coll = new CodeNamespaceCollection ();
			coll.Insert (0, (CodeNamespace) null);
		}
Пример #3
0
		public void Insert ()
		{
			CodeNamespace ns1 = new CodeNamespace ();
			CodeNamespace ns2 = new CodeNamespace ();

			CodeNamespaceCollection coll = new CodeNamespaceCollection ();
			coll.Add (ns1);
			Assert.AreEqual (1, coll.Count, "#1");
			Assert.AreEqual (0, coll.IndexOf (ns1), "#2");
			coll.Insert (0, ns2);
			Assert.AreEqual (2, coll.Count, "#3");
			Assert.AreEqual (1, coll.IndexOf (ns1), "#4");
			Assert.AreEqual (0, coll.IndexOf (ns2), "#5");
		}