public static void MessageInspectorCalled() { var services = new ServiceCollection(); var inspector = new TestDispatchMessageInspector(); var behavior = new TestServiceBehavior { DispatchMessageInspector = inspector }; services.AddSingleton <IServiceBehavior>(behavior); ExtensibilityTestHelper.BuildDispatcherAndCallService(services); Assert.True(inspector.AfterReceiveCalled); Assert.True(inspector.BeforeSendCalled); Assert.True(inspector.CorrelationStateMatch); }
public static void ReplacementMessageUsed() { string replacementEchoString = "bbbbb"; var services = new ServiceCollection(); var inspector = new MessageReplacingDispatchMessageInspector(replacementEchoString); var behavior = new TestServiceBehavior { DispatchMessageInspector = inspector }; services.AddSingleton <IServiceBehavior>(behavior); var service = new DispatcherTestService(); ExtensibilityTestHelper.BuildDispatcherAndCallService(services, service); Assert.Equal(replacementEchoString, service.ReceivedEcho); }