This class provides a MockSender object for a multiple clients and a single end point, which is the Receiver provided in the constructor.
A user must supply the return path and state to use.
Inheritance: MockSender
示例#1
0
 public void NoPType() {
   MockDataHandler idh = new MockDataHandler();
   MockSender mspr = new ThreadedMockSender(null, null, idh, 0);
   byte[] data = new byte[1024];
   RNGCryptoServiceProvider rng = new RNGCryptoServiceProvider();
   rng.GetBytes(data);
   MemBlock mdata = MemBlock.Reference(data);
   object lr = idh.LastReceived;
   mspr.Send(mdata);
   while(lr == idh.LastReceived) {
     Thread.Sleep(0);
   }
   Assert.AreEqual(mdata, idh.LastReceived, "No PType MockSender");
 }
示例#2
0
        public void NoPType()
        {
            MockDataHandler idh  = new MockDataHandler();
            MockSender      mspr = new ThreadedMockSender(null, null, idh, 0);

            byte[] data = new byte[1024];
            RNGCryptoServiceProvider rng = new RNGCryptoServiceProvider();

            rng.GetBytes(data);
            MemBlock mdata = MemBlock.Reference(data);
            object   lr    = idh.LastReceived;

            mspr.Send(mdata);
            while (lr == idh.LastReceived)
            {
                Thread.Sleep(0);
            }
            Assert.AreEqual(mdata, idh.LastReceived, "No PType MockSender");
        }