예제 #1
0
		public void Should_handle_the_uri_type()
		{
			var serializer = new VersionOneXmlMessageSerializer();
			using (var bodyStream = new MemoryStream(Encoding.UTF8.GetBytes(AnotherVersion4Message)))
			{
				var receiveContext = ReceiveContext.FromBodyStream(bodyStream);
				serializer.Deserialize(receiveContext);

				IConsumeContext<ComplaintAdded> context;
				receiveContext.TryGetContext<ComplaintAdded>(out context).ShouldBeTrue();

				context.ShouldNotBeNull();
			}
		}
예제 #2
0
		public void Should_not_cause_fatal_explosions_of_the_fiery_death_kind()
		{
			var serializer = new VersionOneXmlMessageSerializer();
			using (var bodyStream = new MemoryStream(Encoding.UTF8.GetBytes(Version4Message)))
			{
				var receiveContext = ReceiveContext.FromBodyStream(bodyStream);
				serializer.Deserialize(receiveContext);

				IConsumeContext<ComplaintAdded> context;
				receiveContext.TryGetContext<ComplaintAdded>(out context).ShouldBeTrue();

				context.ShouldNotBeNull();
			}
		}
예제 #3
0
        public void Should_handle_the_uri_type()
        {
            var serializer = new VersionOneXmlMessageSerializer();

            using (var bodyStream = new MemoryStream(Encoding.UTF8.GetBytes(AnotherVersion4Message)))
            {
                var receiveContext = ReceiveContext.FromBodyStream(bodyStream);
                serializer.Deserialize(receiveContext);

                IConsumeContext <ComplaintAdded> context;
                receiveContext.TryGetContext <ComplaintAdded>(out context).ShouldBeTrue();

                context.ShouldNotBeNull();
            }
        }
예제 #4
0
        public void Should_not_cause_fatal_explosions_of_the_fiery_death_kind()
        {
            var serializer = new VersionOneXmlMessageSerializer();

            using (var bodyStream = new MemoryStream(Encoding.UTF8.GetBytes(Version4Message)))
            {
                var receiveContext = ReceiveContext.FromBodyStream(bodyStream);
                serializer.Deserialize(receiveContext);

                IConsumeContext <ComplaintAdded> context;
                receiveContext.TryGetContext <ComplaintAdded>(out context).ShouldBeTrue();

                context.ShouldNotBeNull();
            }
        }
        public SupportedMessageSerializers(params IMessageSerializer[] serializers)
        {
            _serializers = new Dictionary<string, IMessageSerializer>();
            _defaultSerializer = () =>
                {
                    var serializer = new VersionOneXmlMessageSerializer();

                    _defaultSerializer = () => serializer;

                    return serializer;
                };

            for (int i = 0; i < serializers.Length; i++)
                AddSerializer(serializers[i]);

            AddSerializer(new JsonMessageSerializer());
            AddSerializer(new BsonMessageSerializer());
            AddSerializer(new XmlMessageSerializer());
            AddSerializer(new BinaryMessageSerializer());
        }