From 7dbb1d24214cece53c7bdefa30a23ac8ee525f01 Mon Sep 17 00:00:00 2001 From: Olivier Coanet Date: Fri, 21 Jul 2023 09:57:57 +0200 Subject: [PATCH] Rename messages and handlers in SyncMessageHandlerInvokerLoaderTests --- .../SyncMessageHandlerInvokerLoaderTests.cs | 78 +++++++++---------- 1 file changed, 39 insertions(+), 39 deletions(-) diff --git a/src/Abc.Zebus.Tests/Scan/SyncMessageHandlerInvokerLoaderTests.cs b/src/Abc.Zebus.Tests/Scan/SyncMessageHandlerInvokerLoaderTests.cs index fdad5207..46beae3a 100644 --- a/src/Abc.Zebus.Tests/Scan/SyncMessageHandlerInvokerLoaderTests.cs +++ b/src/Abc.Zebus.Tests/Scan/SyncMessageHandlerInvokerLoaderTests.cs @@ -18,7 +18,7 @@ public class SyncMessageHandlerInvokerLoaderTests public void should_load_queue_name() { var invokerLoader = new SyncMessageHandlerInvokerLoader(new Container()); - var invoker = invokerLoader.LoadMessageHandlerInvokers(TypeSource.FromType()).ExpectedSingle(); + var invoker = invokerLoader.LoadMessageHandlerInvokers(TypeSource.FromType()).ExpectedSingle(); invoker.DispatchQueueName.ShouldEqual("DispatchQueue1"); } @@ -27,7 +27,7 @@ public void should_load_queue_name() public void should_subscribe_to_standard_handler_on_startup() { var invokerLoader = new SyncMessageHandlerInvokerLoader(new Container()); - var invokers = invokerLoader.LoadMessageHandlerInvokers(TypeSource.FromType()).ToList(); + var invokers = invokerLoader.LoadMessageHandlerInvokers(TypeSource.FromType()).ToList(); invokers.ShouldHaveSize(2); @@ -41,7 +41,7 @@ public void should_subscribe_to_standard_handler_on_startup() public void should_not_subscribe_to_routable_handler_on_startup() { var invokerLoader = new SyncMessageHandlerInvokerLoader(new Container()); - var invoker = invokerLoader.LoadMessageHandlerInvokers(TypeSource.FromType()).ExpectedSingle(); + var invoker = invokerLoader.LoadMessageHandlerInvokers(TypeSource.FromType()).ExpectedSingle(); invoker.GetStartupSubscriptions().ShouldBeEmpty(); } @@ -50,18 +50,18 @@ public void should_not_subscribe_to_routable_handler_on_startup() public void should_subscribe_to_auto_subscribe_routable_message_handler_on_startup() { var invokerLoader = new SyncMessageHandlerInvokerLoader(new Container()); - var invoker = invokerLoader.LoadMessageHandlerInvokers(TypeSource.FromType()).ExpectedSingle(); + var invoker = invokerLoader.LoadMessageHandlerInvokers(TypeSource.FromType()).ExpectedSingle(); - invoker.GetStartupSubscriptions().ShouldBeEquivalentTo(Subscription.Any()); + invoker.GetStartupSubscriptions().ShouldBeEquivalentTo(Subscription.Any()); } [Test] public void should_subscribe_to_auto_subscribe_routable_message_handler_with_auto_subscription_mode_on_startup() { var invokerLoader = new SyncMessageHandlerInvokerLoader(new Container()); - var invoker = invokerLoader.LoadMessageHandlerInvokers(TypeSource.FromType()).ExpectedSingle(); + var invoker = invokerLoader.LoadMessageHandlerInvokers(TypeSource.FromType()).ExpectedSingle(); - invoker.GetStartupSubscriptions().ShouldBeEquivalentTo(Subscription.Any()); + invoker.GetStartupSubscriptions().ShouldBeEquivalentTo(Subscription.Any()); } @@ -69,7 +69,7 @@ public void should_subscribe_to_auto_subscribe_routable_message_handler_with_aut public void should_not_subscribe_to_auto_subscribe_routable_message_handler_with_manual_subscription_mode_on_startup() { var invokerLoader = new SyncMessageHandlerInvokerLoader(new Container()); - var invoker = invokerLoader.LoadMessageHandlerInvokers(TypeSource.FromType()).ExpectedSingle(); + var invoker = invokerLoader.LoadMessageHandlerInvokers(TypeSource.FromType()).ExpectedSingle(); invoker.GetStartupSubscriptions().ShouldBeEmpty(); } @@ -78,7 +78,7 @@ public void should_not_subscribe_to_auto_subscribe_routable_message_handler_with public void should_switch_to_manual_subscription_mode_when_specified() { var invokerLoader = new SyncMessageHandlerInvokerLoader(new Container()); - var invoker = invokerLoader.LoadMessageHandlerInvokers(TypeSource.FromType()).ExpectedSingle(); + var invoker = invokerLoader.LoadMessageHandlerInvokers(TypeSource.FromType()).ExpectedSingle(); invoker.GetStartupSubscriptions().ShouldBeEmpty(); } @@ -87,9 +87,9 @@ public void should_switch_to_manual_subscription_mode_when_specified() public void should_switch_to_auto_subscription_mode_when_specified() { var invokerLoader = new SyncMessageHandlerInvokerLoader(new Container()); - var invoker = invokerLoader.LoadMessageHandlerInvokers(TypeSource.FromType()).ExpectedSingle(); + var invoker = invokerLoader.LoadMessageHandlerInvokers(TypeSource.FromType()).ExpectedSingle(); - var expectedSubscription = Subscription.Any(); + var expectedSubscription = Subscription.Any(); invoker.GetStartupSubscriptions().ShouldBeEquivalentTo(expectedSubscription); } @@ -97,9 +97,9 @@ public void should_switch_to_auto_subscription_mode_when_specified() public void should_use_startup_subscriber() { var invokerLoader = new SyncMessageHandlerInvokerLoader(new Container()); - var invoker = invokerLoader.LoadMessageHandlerInvokers(TypeSource.FromType()).ExpectedSingle(); + var invoker = invokerLoader.LoadMessageHandlerInvokers(TypeSource.FromType()).ExpectedSingle(); - var expectedSubscription = new Subscription(MessageUtil.TypeId(), new BindingKey("123")); + var expectedSubscription = new Subscription(MessageUtil.TypeId(), new BindingKey("123")); invoker.GetStartupSubscriptions().ShouldBeEquivalentTo(expectedSubscription); } @@ -114,19 +114,19 @@ public void should_throw_exception_if_method_is_async_void() public void should_not_throw_if_scanning_handler_with_several_handle_methods() { var invokerLoader = new SyncMessageHandlerInvokerLoader(new Container()); - Assert.DoesNotThrow(() => invokerLoader.LoadMessageHandlerInvokers(TypeSource.FromType()).ToList()); + Assert.DoesNotThrow(() => invokerLoader.LoadMessageHandlerInvokers(TypeSource.FromType()).ToList()); } - public class FakeMessage : IMessage + public class TestMessage1 : IMessage { } - public class FakeMessage2 : IMessage + public class TestMessage2 : IMessage { } [Routable] - public class FakeRoutableMessage : IMessage + public class TestRoutableMessage : IMessage { [RoutingPosition(1)] public string Key; @@ -134,92 +134,92 @@ public class FakeRoutableMessage : IMessage [Routable(AutoSubscribe = true)] - public class FakeRoutableMessageWithAutoSubscribe : IMessage + public class TestAutoSubscribeRoutableMessage : IMessage { [RoutingPosition(1)] public string Key; } - public class FakeHandler : IMessageHandler, IMessageHandler + public class TestHandler : IMessageHandler, IMessageHandler { - public void Handle(FakeMessage message) + public void Handle(TestMessage1 message) { throw new NotImplementedException(); } - public void Handle(FakeMessage2 message) + public void Handle(TestMessage2 message) { throw new NotImplementedException(); } } - public class WrongAsyncHandler : IMessageHandler + public class WrongAsyncHandler : IMessageHandler { - public async void Handle(FakeMessage message) + public async void Handle(TestMessage1 message) { await Task.CompletedTask; } } [DispatchQueueName("DispatchQueue1")] - public class FakeHandlerWithQueueName1 : IMessageHandler + public class TestHandler_DispatchQueue1 : IMessageHandler { - public void Handle(FakeMessage message) + public void Handle(TestMessage1 message) { } } [SubscriptionMode(SubscriptionMode.Manual)] - public class FakeHandlerWithManualSubscriptionMode : IMessageHandler + public class TestHandler_ManualSubscriptionMode : IMessageHandler { - public void Handle(FakeMessage message) + public void Handle(TestMessage1 message) { } } [SubscriptionMode(SubscriptionMode.Auto)] - public class FakeRoutableHandlerWithAutoSubscriptionMode : IMessageHandler + public class TestRoutableHandler_AutoSubscriptionMode : IMessageHandler { - public void Handle(FakeRoutableMessage message) + public void Handle(TestRoutableMessage message) { } } - public class FakeRoutableHandler : IMessageHandler + public class TestRoutableHandler : IMessageHandler { - public void Handle(FakeRoutableMessage message) + public void Handle(TestRoutableMessage message) { } } - public class FakeRoutableMessageWithAutoSubscribeHandler : IMessageHandler + public class TestAutoSubscribeRoutableHandler : IMessageHandler { - public void Handle(FakeRoutableMessageWithAutoSubscribe message) + public void Handle(TestAutoSubscribeRoutableMessage message) { } } [SubscriptionMode(SubscriptionMode.Auto)] - public class FakeRoutableMessageWithAutoSubscribeHandler_Auto : IMessageHandler + public class TestAutoSubscribeRoutableHandler_AutoSubscriptionMode : IMessageHandler { - public void Handle(FakeRoutableMessageWithAutoSubscribe message) + public void Handle(TestAutoSubscribeRoutableMessage message) { } } [SubscriptionMode(SubscriptionMode.Manual)] - public class FakeRoutableMessageWithAutoSubscribeHandler_Manual : IMessageHandler + public class TestAutoSubscribeRoutableHandler_ManualSubscriptionMode : IMessageHandler { - public void Handle(FakeRoutableMessageWithAutoSubscribe message) + public void Handle(TestAutoSubscribeRoutableMessage message) { } } [SubscriptionMode(typeof(StartupSubscriber))] - public class FakeRoutableHandlerWithStartupSubscriber : IMessageHandler + public class TestRoutableHandler_StartupSubscriber : IMessageHandler { - public void Handle(FakeRoutableMessage message) + public void Handle(TestRoutableMessage message) { }