Esempio n. 1
0
        public void Pick_NoMessageOnQueue_ReturnsNull()
        {
            // Arrange
            var bus = InternalBusCreator.CreateBus();
            var picker = new MessagePicker(bus);

            // Act
            object[] nextMessage = picker.PickMessage(@".\Private$\orderservice");

            // Assert
            Assert.That(nextMessage, Is.Null);
        }
Esempio n. 2
0
        public void Pick_MessageOnQueue_MessageIsDeserialized()
        {
            // Arrange
            object[] message;

            using (var bus = InternalBusCreator.CreateBus())
            {
                var picker = new MessagePicker(bus);
                var stuffer = new MessageStuffer(bus);

                stuffer.PutMessageOnQueue<IPlaceAnOrder>(msg => { msg.Product = "a"; }, "orderservice");

                // Act
                message = picker.PickMessage(@".\Private$\orderservice");
            }

            // Assert
            Assert.That(message.Length, Is.EqualTo(1));
        }