示例#1
0
 public void U_Formater_FormatMessage_Trigered()
 {
     var persister = new AsyncMessagePersister(new FileMessageWriter(_formaterMock.Object));
     var message = new MessagePersisterComponent.Message(Guid.NewGuid(), "test", "test");
     persister.Persist(message);
     persister.Stop();
     _formaterMock.Verify(
         t => t.FormatMessage(It.IsAny<MessagePersisterComponent.Message>()));
 }
示例#2
0
        private static void Main(string[] args)
        {
            //case 1
            //IMessagerPersister persister = new AsyncMessagePersister();
            //var moqMessage = new MessageGenerator(persister, 1);
            //Thread.Sleep(2000);
            //persister.Stop();
            //while (!persister.Stoped) Thread.Sleep(100);
            //moqMessage.Dispose();
            //Console.WriteLine("Press enter to proceed to case 2");
            //Console.ReadLine();

            //case 2
            IMessagerPersister anotherPersister = new AsyncMessagePersister();
            TestPersister(anotherPersister);
            Console.WriteLine("Press enter to Exit");
            Console.ReadLine();
        }