public async Task Should_not_store_returninfo_for_legacy_messages_missing_both_kinds_of_from_information() { var headersWithoutFrom = new Dictionary <string, string>(); var context = new IncomingPhysicalMessageContextFake(null, headersWithoutFrom); await new GatewayIncomingBehavior().Invoke(context, () => Task.FromResult(0)); Assert.IsFalse(context.Extensions.TryGet(out GatewayIncomingBehavior.ReturnState _)); }
public async Task Should_store_returninfo_for_messages_with_originatingsite() { var headers = new Dictionary <string, string> { [Headers.OriginatingSite] = originatingSite, [Headers.ReplyToAddress] = addressOfOriginatingEndpoint, [GatewayHeaders.LegacyMode] = "false" }; var state = new GatewayIncomingBehavior.ReturnState(); var context = new IncomingPhysicalMessageContextFake(state, headers); await new GatewayIncomingBehavior().Invoke(context, () => Task.FromResult(0)); Assert.AreEqual(originatingSite, state.OriginatingSite); Assert.AreEqual(addressOfOriginatingEndpoint, state.ReplyToAddress); Assert.AreEqual(false, state.LegacyMode); }