本文整理汇总了C#中FubuTransportation.Runtime.Envelope.ForResponse方法的典型用法代码示例。如果您正苦于以下问题:C# Envelope.ForResponse方法的具体用法?C# Envelope.ForResponse怎么用?C# Envelope.ForResponse使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FubuTransportation.Runtime.Envelope
的用法示例。
在下文中一共展示了Envelope.ForResponse方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: parent_that_is_not_original_creating_child_envelope
public void parent_that_is_not_original_creating_child_envelope()
{
var parent = new Envelope
{
CorrelationId = Guid.NewGuid().ToString(),
OriginalId = Guid.NewGuid().ToString()
};
var childMessage = new Message1();
var child = parent.ForResponse(childMessage);
child.Message.ShouldBeTheSameAs(childMessage);
child.OriginalId.ShouldEqual(parent.OriginalId);
child.ParentId.ShouldEqual(parent.CorrelationId);
}
示例2: if_reply_requested_header_exists_in_parent_and_does_NOT_match_the_message_type
public void if_reply_requested_header_exists_in_parent_and_does_NOT_match_the_message_type()
{
var parent = new Envelope
{
CorrelationId = Guid.NewGuid().ToString(),
OriginalId = Guid.NewGuid().ToString(),
ReplyUri = "foo://bar".ToUri(),
ReplyRequested = typeof(Message2).Name
};
var childMessage = new Message1();
var child = parent.ForResponse(childMessage);
child.Headers.Has(Envelope.ResponseIdKey).ShouldBeFalse();
child.Destination.ShouldBeNull();
}
示例3: if_reply_requested_header_exists_in_parent_and_matches_the_message_type
public void if_reply_requested_header_exists_in_parent_and_matches_the_message_type()
{
var parent = new Envelope
{
CorrelationId = Guid.NewGuid().ToString(),
OriginalId = Guid.NewGuid().ToString(),
ReplyUri = "foo://bar".ToUri(),
ReplyRequested = typeof(Message1).Name
};
var childMessage = new Message1();
var child = parent.ForResponse(childMessage);
child.Headers[Envelope.ResponseIdKey].ShouldEqual(parent.CorrelationId);
child.Destination.ShouldEqual(parent.ReplyUri);
}
示例4: do_not_set_destination_or_response_if_requested_header_does_not_exist_in_parent
public void do_not_set_destination_or_response_if_requested_header_does_not_exist_in_parent()
{
var parent = new Envelope
{
CorrelationId = Guid.NewGuid().ToString(),
OriginalId = Guid.NewGuid().ToString(),
Source = "foo://bar".ToUri()
};
parent.Headers.Has(Envelope.ReplyRequestedKey).ShouldBeFalse();
var childMessage = new Message1();
var child = parent.ForResponse(childMessage);
child.Headers.Has(Envelope.ResponseIdKey).ShouldBeFalse();
child.Destination.ShouldBeNull();
}