Microsoft.Ccr.Core.PortTest.OneShotReceiverReturnsTask C# (CSharp) Method

OneShotReceiverReturnsTask() private method

private OneShotReceiverReturnsTask ( ) : void
return void
        public void OneShotReceiverReturnsTask()
        {
            var p = new Port<int> ();
            IPortReceive ipr = p;
            VoidDispatcherQueue dq = new VoidDispatcherQueue ();
            ReceiverTask rt = new EvalTask (true, new NullTask ());
            rt.State = ReceiverTaskState.Onetime;
            rt.TaskQueue = dq;
            ipr.RegisterReceiver (rt);

            Assert.AreEqual (1, ipr.GetReceivers ().Length, "#1");
            p.Post (10);
            Assert.AreEqual (1, dq.queuedTasks, "#2");
            Assert.AreEqual (0, ipr.GetReceivers ().Length, "#3");
        }