Remove() public method

public Remove ( System attribute ) : void
attribute System
return void
		private void CommonStuff (CryptographicAttributeObjectCollection coll)
		{
			Assert.IsFalse (coll.IsSynchronized, "IsSynchronized");
			Assert.AreSame (coll, coll.SyncRoot, "SyncRoot");
			Assert.IsNotNull (coll.GetEnumerator (), "GetEnumerator");

			int i = coll.Count;
			Oid o1 = new Oid ("1.2.840.113549.1.7.3");
			AsnEncodedData aed = new AsnEncodedData (o1, new byte[] { 0x05, 0x00 });
			Assert.AreEqual (i, coll.Add (aed), "Add(AsnEncodedData)");
			Assert.IsTrue ((coll[i++] is CryptographicAttributeObject), "converted");

			Oid o2 = new Oid ("1.2.840.113549.1.7.2");
			CryptographicAttributeObject cao = new CryptographicAttributeObject (o2);
			Assert.AreEqual (i, coll.Add (cao), "Add(CryptographicAttributeObject)");

			CryptographicAttributeObject[] array = new CryptographicAttributeObject [coll.Count];
			coll.CopyTo (array, 0);

			Array a = (Array) new object [coll.Count];
			ICollection c = (ICollection) coll;
			c.CopyTo (a, 0);

			IEnumerable e = (IEnumerable) coll;
			Assert.IsNotNull (e.GetEnumerator (), "GetEnumerator");

			coll.Remove (cao);
			Assert.AreEqual (i, coll.Count, "Remove(CryptographicAttributeObject)");
		}
		public void Remove_MultipleSameOid_Last ()
		{
			Oid o = new Oid (defaultOid);
			CryptographicAttributeObject cao = new CryptographicAttributeObject (o);
			CryptographicAttributeObjectCollection coll = new CryptographicAttributeObjectCollection (cao);

			Oid o1 = new Oid (defaultOid);
			AsnEncodedData aed = new AsnEncodedData (o1, new byte[] { 0x04, (byte) 0 });
			coll.Add (aed);

			aed = new AsnEncodedData (o1, new byte[] { 0x04, (byte) 0 });
			coll.Add (aed);

			Oid o2 = new Oid (defaultOid);
			CryptographicAttributeObject last = new CryptographicAttributeObject (o2);
			coll.Add (last);

			Assert.AreEqual (1, coll.Count, "before Remove");
			coll.Remove (last);
			Assert.AreEqual (1, coll.Count, "after Remove");
		}
		public void Remove_WithDifferentInstance ()
		{
			Oid o = new Oid (defaultOid);
			CryptographicAttributeObject cao = new CryptographicAttributeObject (o);
			CryptographicAttributeObjectCollection coll = new CryptographicAttributeObjectCollection (cao);

			Assert.AreEqual (1, coll.Count, "before Remove");
			cao = new CryptographicAttributeObject (o);
			coll.Remove (cao);
			Assert.AreEqual (1, coll.Count, "after Remove");
		}
		public void Remove_Null_WithNullItem ()
		{
			CryptographicAttributeObjectCollection coll = new CryptographicAttributeObjectCollection (null);
			Assert.AreEqual (1, coll.Count, "Count");
			Assert.IsNull (coll[0], "this[int]");
			coll.Remove (null);
		}