From f44de61fbc577bf259b0e26a04c126da9e719d41 Mon Sep 17 00:00:00 2001 From: hadashiA Date: Fri, 29 Mar 2024 16:56:02 +0900 Subject: [PATCH] Fix build --- .../Assets/Tests/VContainerTest.cs | 25 ++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/src/MessagePipe.Unity/Assets/Tests/VContainerTest.cs b/src/MessagePipe.Unity/Assets/Tests/VContainerTest.cs index ede5d6d..1d58595 100644 --- a/src/MessagePipe.Unity/Assets/Tests/VContainerTest.cs +++ b/src/MessagePipe.Unity/Assets/Tests/VContainerTest.cs @@ -13,7 +13,12 @@ public class VContainerTest [Test] public void SimpelePush() { - var resolver = TestHelper.BuildVContainer(); + var resolver = TestHelper.BuildVContainer((options, builder) => + { +#if !UNITY_2022_1_OR_NEWER + builder.RegisterMessageBroker(options); +#endif + }); var pub = resolver.Resolve>(); var sub1 = resolver.Resolve>(); @@ -37,7 +42,12 @@ public void SimpelePush() [UnityTest] public IEnumerator SimpleAsyncPush() => UniTask.ToCoroutine(async () => { - var resolver = TestHelper.BuildVContainer(); + var resolver = TestHelper.BuildVContainer((options, builder) => + { +#if !UNITY_2022_1_OR_NEWER + builder.RegisterMessageBroker(options); +#endif + }); var pub = resolver.Resolve>(); var sub1 = resolver.Resolve>(); @@ -68,6 +78,10 @@ public void WithFilter() options.AddGlobalMessageHandlerFilter>(1200); }, (options, builder) => { +#if !UNITY_2022_1_OR_NEWER + builder.RegisterMessageBroker(options); +#endif + builder.RegisterMessageHandlerFilter>(); builder.RegisterInstance(store); }); @@ -152,7 +166,12 @@ public void RequestAll() [Test] public void Buffered() { - var provider = TestHelper.BuildVContainer(); + var provider = TestHelper.BuildVContainer((options, builder) => + { +#if !UNITY_2022_1_OR_NEWER + builder.RegisterMessageBroker(options); +#endif + }); var p = provider.Resolve>(); var s = provider.Resolve>();