Initial Commit

This commit is contained in:
2026-03-16 14:38:46 +02:00
commit b8f7327a21
2327 changed files with 253610 additions and 0 deletions
@@ -0,0 +1,59 @@
using System.Collections;
using ModestTree;
using UnityEngine;
using UnityEngine.TestTools;
namespace Zenject.Tests.Bindings.FromGameObjectInstaller
{
public class TestFromGameObjectInstaller : ZenjectIntegrationTestFixture
{
[UnityTest]
public IEnumerator TestInstaller()
{
PreInstall();
Container.Bind<Qux>().FromSubContainerResolve()
.ByNewGameObjectInstaller<FooInstaller>().AsCached();
PostInstall();
Assert.IsEqual(Container.Resolve<Qux>().Data, "asdf");
yield break;
}
[UnityTest]
public IEnumerator TestMethod()
{
PreInstall();
Container.Bind<Qux>().FromSubContainerResolve()
.ByNewGameObjectMethod(InstallFoo).AsCached();
PostInstall();
Assert.IsEqual(Container.Resolve<Qux>().Data, "asdf");
yield break;
}
void InstallFoo(DiContainer subContainer)
{
subContainer.Bind<Qux>().AsSingle().WithArguments("asdf");
}
public class Qux
{
[Inject]
public string Data;
}
public class FooInstaller : Installer<FooInstaller>
{
public override void InstallBindings()
{
Container.Bind<Qux>().AsSingle().WithArguments("asdf");
}
}
}
}
@@ -0,0 +1,13 @@
fileFormatVersion: 2
guid: c0dfdf55fcc548d47b0b804800f9c7e5
timeCreated: 1538468409
licenseType: Pro
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: