public void TestConstructor() { using (ServicePublisher pub = new ServicePublisher()) { Assert.IsTrue(MessageQueue.Exists(@".\Private$\IQ1")); } }
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); }