Example #1
0
 public void UnRegisterReceiverIgnoreNonRegistered()
 {
     IPortReceive ipr = new Port<int> ();
     ReceiverTask rt = new EvalTask (true);
     ipr.UnregisterReceiver (rt);
 }
Example #2
0
        public void UnRegisterReceiverChangesGetReceivers()
        {
            IPortReceive ipr = new Port<int> ();
            ReceiverTask rt = new EvalTask (true);

            Assert.AreEqual (0, ipr.GetReceivers ().Length, "#1");
            ipr.RegisterReceiver (rt);
            ipr.RegisterReceiver (rt);
            Assert.AreEqual (2, ipr.GetReceivers ().Length, "#3");
            ipr.UnregisterReceiver (rt);
            Assert.AreEqual (1, ipr.GetReceivers ().Length, "#4");
            ipr.UnregisterReceiver (rt);
            Assert.AreEqual (0, ipr.GetReceivers ().Length, "#5");
        }