Пример #1
0
 public void protobuf_serialization_can_deserialized_guids()
 {
     RuntimeTypeModel.Default[typeof(GatewayPageEvent)].AddSubType(3, typeof(GatewayPageAddedToSite));
     var originalMessage = new GatewayPageAddedToSite
                               {GatewayPageId = Guid.NewGuid(), SiteCode = "dls", Url = "test"};
     var serializedMessage = Serialize(originalMessage);
     var @event = (GatewayPageAddedToSite) Deserialize(serializedMessage, typeof (GatewayPageAddedToSite));
     Assert.AreEqual(originalMessage.GatewayPageId, @event.GatewayPageId);
 }
Пример #2
0
        public void protobuf_serialization_can_deserialized_guids()
        {
            RuntimeTypeModel.Default[typeof(GatewayPageEvent)].AddSubType(3, typeof(GatewayPageAddedToSite));
            var originalMessage = new GatewayPageAddedToSite
            {
                GatewayPageId = Guid.NewGuid(), SiteCode = "dls", Url = "test"
            };
            var serializedMessage = Serialize(originalMessage);
            var @event            = (GatewayPageAddedToSite)Deserialize(serializedMessage, typeof(GatewayPageAddedToSite));

            Assert.AreEqual(originalMessage.GatewayPageId, @event.GatewayPageId);
        }