public void ProcesedMessageEventSequence_11()
        {
            var sut = new ServiceEvents();
            List<ReceivedMessage> events = new List<ReceivedMessage>();
            var elements = (22).Times<ReceivedMessage>(new Func<ReceivedMessage>(() =>
            {
                return new ReceivedMessage
                {
                    EventID = Guid.NewGuid(),
                    MessageHandler = StringExtension.RandomString(),
                    MessageType = StringExtension.RandomString(),
                    Topic = StringExtension.RandomString()
                };
            }));
            events.AddRange(elements);
            events.ForEach(e => sut.AddProcesedMessageEvent(e));
            sut.ProcesedMessageEventSequence.Subscribe(i =>
            {
                Assert.True(events.Contains(i));
                events.Remove(i);
            });

            Assert.Equal(events.Count, 12);
        }
 public void ProcesedMessageEventSequence()
 {
     var sut = new ServiceEvents();
     var callbackCalled = false;
     var message = new ReceivedMessage
     {
         EventID = Guid.NewGuid(),
         MessageHandler = StringExtension.RandomString(),
         MessageType = StringExtension.RandomString(),
         Topic = StringExtension.RandomString()
     };
     sut.ProcesedMessageEventSequence.Subscribe(i =>
     {
         Assert.Same(i, message);
         callbackCalled = true;
     });
     sut.AddProcesedMessageEvent(message);
     Assert.True(callbackCalled);
 }