コード例 #1
0
 public void TestConstructor()
 {
     using (ServicePublisher pub = new ServicePublisher())
     {
         Assert.IsTrue(MessageQueue.Exists(@".\Private$\IQ1"));
     }
 }
コード例 #2
0
 public void TestSendMessage()
 {
     Service service = new Service();
     using (ServicePublisher publisher = new ServicePublisher())
     {
         publisher.Send(service);
     }
     MessageQueue mq = new MessageQueue(@".\Private$\IQ1");
     Message[] messages = mq.GetAllMessages();
     mq.Purge();
     Assert.AreEqual(1, messages.Length);
 }