Exemple #1
0
		public void Deny_Unrestricted ()
		{
			// note: using the same control (as owner) to add results 
			// in killing the ms runtime with a stackoverflow - FDBK36722
			ControlCollection cc = new ControlCollection (new Control ());
			Assert.AreEqual (0, cc.Count, "Count");
			Assert.IsFalse (cc.IsReadOnly, "IsReadOnly");
			Assert.IsFalse (cc.IsSynchronized, "IsSynchronized");
			Assert.IsNotNull (cc.SyncRoot, "SyncRoot");

			cc.Add (control);
			Assert.IsNotNull (cc[0], "this[int]");
			cc.Clear ();
			cc.AddAt (0, control);
			Assert.IsTrue (cc.Contains (control), "Contains");

			cc.CopyTo (new Control[1], 0);
			Assert.IsNotNull (cc.GetEnumerator (), "GetEnumerator");
			Assert.AreEqual (0, cc.IndexOf (control), "IndexOf");
			cc.RemoveAt (0);
			cc.Remove (control);
		}