Remove() public method

public Remove ( System recipient ) : void
recipient System
return void
コード例 #1
0
 public static void RemoveNonExistent()
 {
     CmsRecipientCollection c = new CmsRecipientCollection();
     CmsRecipient a0 = s_cr0;
     c.Remove(a0);  // You can "remove" items that aren't in the collection - this is defined as a NOP.
 }
コード例 #2
0
        public static void Remove()
        {
            CmsRecipient a0 = s_cr0;
            CmsRecipient a1 = s_cr1;
            CmsRecipient a2 = s_cr2;

            CmsRecipientCollection c = new CmsRecipientCollection();
            int index;
            index = c.Add(a0);
            Assert.Equal(0, index);
            index = c.Add(a1);
            Assert.Equal(1, index);
            index = c.Add(a2);
            Assert.Equal(2, index);

            c.Remove(a1);

            AssertEquals(c, new CmsRecipient[] { a0, a2 });
        }
コード例 #3
0
 public static void RemoveNegative()
 {
     CmsRecipientCollection c = new CmsRecipientCollection();
     Assert.Throws<ArgumentNullException>(() => c.Remove(null));
 }