Skip to content

Commit

Permalink
Fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
hadashiA committed Mar 29, 2024
1 parent ba5d859 commit f44de61
Showing 1 changed file with 22 additions and 3 deletions.
25 changes: 22 additions & 3 deletions src/MessagePipe.Unity/Assets/Tests/VContainerTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<int>(options);
#endif
});

var pub = resolver.Resolve<IPublisher<int>>();
var sub1 = resolver.Resolve<ISubscriber<int>>();
Expand All @@ -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<int>(options);
#endif
});

var pub = resolver.Resolve<IAsyncPublisher<int>>();
var sub1 = resolver.Resolve<IAsyncSubscriber<int>>();
Expand Down Expand Up @@ -68,6 +78,10 @@ public void WithFilter()
options.AddGlobalMessageHandlerFilter<MyFilter<int>>(1200);
}, (options, builder) =>
{
#if !UNITY_2022_1_OR_NEWER
builder.RegisterMessageBroker<int>(options);
#endif

builder.RegisterMessageHandlerFilter<MyFilter<int>>();
builder.RegisterInstance(store);
});
Expand Down Expand Up @@ -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<IntClass>(options);
#endif
});

var p = provider.Resolve<IBufferedPublisher<IntClass>>();
var s = provider.Resolve<IBufferedSubscriber<IntClass>>();
Expand Down

0 comments on commit f44de61

Please sign in to comment.