public void ShouldNotCallDispatcherIfOrderDoesNotValidate()
        {
            var processor = new IncomingMessageProcessor(ordereRepositoryMock.Object, outgoingQueueMock.Object, dateServiceMock.Object, orderDispatcherMock.Object, serializer);

            var invalidLimitOrder = new LimitOrderDto();

            invalidLimitOrder.Reeset();

            var messageBytes = serializer.Serialize(new ClientToServerMessageQueueItem
            {
                Message = new ClientToServerMessage
                {
                    ClientId    = 1,
                    LimitOrder  = invalidLimitOrder,
                    MessageType = ClientToServerMessageTypeEnum.PlaceLimitOrder
                },
            });

            var queueItem = new RingbufferByteArray();

            queueItem.Set(messageBytes);

            processor.OnEvent(queueItem, 1, true);

            orderDispatcherMock.Verify(a => a.HandleAddLimitOrder(It.IsAny <ILimitOrder>()), Times.Never);
            outgoingQueueMock.Verify(a => a.EnqueueAddedLimitOrder(It.IsAny <ILimitOrder>()), Times.Never);
        }
        public void ShouldNotCallDispatcherWhenLimitOrderIsInvalid()
        {
            var processor = new IncomingMessageProcessor(ordereRepositoryMock.Object, outgoingQueueMock.Object, dateServiceMock.Object, orderDispatcherMock.Object, serializer);

            var limitOrder = new LimitOrderDto();

            limitOrder.Reeset();
            limitOrder.Symbol   = "QQQ";
            limitOrder.Price    = -1;
            limitOrder.Quantity = -1;
            limitOrder.ClientId = 1;
            limitOrder.Way      = WayEnum.Sell;

            var messageBytes = serializer.Serialize(new ClientToServerMessageQueueItem
            {
                Message =

                    new ClientToServerMessage
                {
                    ClientId    = 1,
                    LimitOrder  = limitOrder,
                    MessageType = ClientToServerMessageTypeEnum.PlaceLimitOrder
                }
            });

            var queueItem = new RingbufferByteArray();

            queueItem.Set(messageBytes);

            processor.OnEvent(queueItem, 1, true);
            orderDispatcherMock.Verify(a => a.HandleAddLimitOrder(It.IsAny <ILimitOrder>()), Times.Never);
        }