Пример #1
0
        public void BrokeredMessageSerializationError()
        {
            var pinkoContainer = PinkoContainerMock.GetMockContainer();
            var pm = new SerializableTestType { ClientMachine = "ClientMachine", ServerMachine = "ServerMachine" };
            var bm = AzureQueueClient.FactorNewOutboundMessage(new PinkoServiceMessageEnvelop() { Message = pm });

            // check for proepr deserialization
            var abm = new AzureBrokeredMessageEnvelopInbound(pinkoContainer.Resolve<IPinkoApplication>(), bm);
            Assert.IsNull(abm.Message);
            Assert.IsTrue(bm.ContentType.Equals(typeof(SerializableTestType).ToString()));
        }
Пример #2
0
        public void BrokeredMessageSerialization()
        {
            var pinkoContainer = PinkoContainerMock.GetMockContainer();
            var pm = new PinkoMsgPing { SenderMachine = "ClientMachine", ResponderMachine = "ServerMachine" };
            var bm = AzureQueueClient.FactorNewOutboundMessage(new PinkoServiceMessageEnvelop() {Message = pm});

            // check for proepr deserialization
            var abm = new AzureBrokeredMessageEnvelopInbound(pinkoContainer.Resolve<IPinkoApplication>(), bm);
            Assert.IsNotNull(abm.Message);
            Assert.IsTrue(abm.Message.GetType() == typeof(PinkoMsgPing));
            Assert.IsTrue(bm.ContentType.Equals(typeof(PinkoMsgPing).ToString()));

            Assert.IsTrue(abm.PinkoProperties.ContainsKey(PinkoMessagePropTag.MachineName));
            Assert.IsTrue(abm.PinkoProperties.ContainsKey(PinkoMessagePropTag.SenderName));
        }