コード例 #1
0
        public when_creating_a_service_bus_with_acknowledgement_required_envelope()
        {
            theEnvelope               = ObjectMother.Envelope();
            theEnvelope.Id            = Guid.NewGuid();
            theEnvelope.CorrelationId = Guid.NewGuid();
            theEnvelope.ReplyUri      = "tcp://server2:2000".ToUri();

            theEnvelope.AckRequested = true;

            theAcknowledgement = new AcknowledgementSender(null, MessagingSerializationGraph.Basic()).BuildAcknowledgement(theEnvelope);
        }
コード例 #2
0
        public void can_try_to_deserialize_an_envelope_with_no_message_type_or_content_type()
        {
            var serialization = MessagingSerializationGraph.Basic();

            var json = JsonConvert.SerializeObject(new Message2(), new JsonSerializerSettings
            {
                TypeNameHandling = TypeNameHandling.All
            });

            var envelope = new Envelope()
            {
                Data        = Encoding.UTF8.GetBytes(json),
                MessageType = null,
                ContentType = null
            };

            serialization.Deserialize(envelope)
            .ShouldBeOfType <Message2>();
        }