From 03a20b0371c7bf427911b4dbf09f1ddcc173cbdb Mon Sep 17 00:00:00 2001 From: Steve Vermeulen Date: Sat, 30 Apr 2016 20:25:33 -0300 Subject: [PATCH] Added integration tests --- Build/python/mtm/zen/CreateRelease.py | 4 + .../OptionalExtras/IntegrationTests.meta | 9 + .../IntegrationTests/Bindings.meta | 9 + .../Bindings/BindGameObject.meta | 9 + .../BindGameObject/BindGameObject.unity | 156 +++++++++++++ .../BindGameObject/BindGameObject.unity.meta} | 4 +- .../Bindings/BindGameObject/Fixture.cs | 132 +++++++++++ .../Bindings/BindGameObject/Fixture.cs.meta | 12 + .../Bindings/BindGameObject/Resources.meta | 9 + .../Resources/BindGameObject.meta | 9 + .../Resources/BindGameObject/Cube.prefab | 88 +++++++ .../Resources/BindGameObject/Cube.prefab.meta | 8 + .../Bindings/TestToGameObject.meta | 9 + .../Bindings/TestToGameObject/Fixture.cs | 143 ++++++++++++ .../Bindings/TestToGameObject/Fixture.cs.meta | 12 + .../TestToGameObject/TestToGameObject.unity | 155 +++++++++++++ .../TestToGameObject.unity.meta | 8 + .../Bindings/TestToMonoBehaviour.meta | 9 + .../Bindings/TestToMonoBehaviour/Fixture.cs | 135 +++++++++++ .../TestToMonoBehaviour/Fixture.cs.meta | 12 + .../Bindings/TestToMonoBehaviour/Foo.cs | 12 + .../Bindings/TestToMonoBehaviour/Foo.cs.meta | 12 + .../TestToMonoBehaviour.unity | 155 +++++++++++++ .../TestToMonoBehaviour.unity.meta | 8 + .../Bindings/TestToPrefab.meta | 9 + .../Bindings/TestToPrefab/Bar.cs | 8 + .../Bindings/TestToPrefab/Bar.cs.meta | 12 + .../Bindings/TestToPrefab/Bob.cs | 13 ++ .../Bindings/TestToPrefab/Bob.cs.meta | 12 + .../Bindings/TestToPrefab/Fixture.cs | 165 ++++++++++++++ .../Bindings/TestToPrefab/Fixture.cs.meta | 12 + .../Bindings/TestToPrefab/Foo.cs | 12 + .../Bindings/TestToPrefab/Foo.cs.meta | 12 + .../Bindings/TestToPrefab/Foo.prefab | 64 ++++++ .../Bindings/TestToPrefab/Foo.prefab.meta | 8 + .../Bindings/TestToPrefab/Foo2.prefab | 52 +++++ .../Bindings/TestToPrefab/Foo2.prefab.meta | 8 + .../Bindings/TestToPrefab/Gorp.cs | 17 ++ .../Bindings/TestToPrefab/Gorp.cs.meta | 12 + .../Bindings/TestToPrefab/Jim.cs | 13 ++ .../Bindings/TestToPrefab/Jim.cs.meta | 12 + .../Bindings/TestToPrefab/JimAndBob.prefab | 64 ++++++ .../TestToPrefab/JimAndBob.prefab.meta | 8 + .../Bindings/TestToPrefab/Norf.cs | 13 ++ .../Bindings/TestToPrefab/Norf.cs.meta | 12 + .../Bindings/TestToPrefab/Norf.prefab | 76 +++++++ .../Bindings/TestToPrefab/Norf.prefab.meta | 8 + .../Bindings/TestToPrefab/Norf2.cs | 10 + .../Bindings/TestToPrefab/Norf2.cs.meta | 12 + .../Bindings/TestToPrefab/Qux.cs | 17 ++ .../Bindings/TestToPrefab/Qux.cs.meta | 12 + .../Bindings/TestToPrefab/QuxAndGorp.prefab | 64 ++++++ .../TestToPrefab/QuxAndGorp.prefab.meta | 8 + .../Bindings/TestToPrefab/TestToPrefab.unity | 160 +++++++++++++ .../TestToPrefab/TestToPrefab.unity.meta | 8 + .../Bindings/TestToPrefabResource.meta | 9 + .../Bindings/TestToPrefabResource/Bar.cs | 8 + .../Bindings/TestToPrefabResource/Bar.cs.meta | 12 + .../Bindings/TestToPrefabResource/Bob.cs | 13 ++ .../Bindings/TestToPrefabResource/Bob.cs.meta | 12 + .../Bindings/TestToPrefabResource/Fixture.cs | 172 ++++++++++++++ .../TestToPrefabResource/Fixture.cs.meta | 12 + .../Bindings/TestToPrefabResource/Foo.cs | 12 + .../Bindings/TestToPrefabResource/Foo.cs.meta | 12 + .../Bindings/TestToPrefabResource/Gorp.cs | 17 ++ .../TestToPrefabResource/Gorp.cs.meta | 12 + .../Bindings/TestToPrefabResource/Jim.cs | 13 ++ .../Bindings/TestToPrefabResource/Jim.cs.meta | 12 + .../Bindings/TestToPrefabResource/Norf.cs | 13 ++ .../TestToPrefabResource/Norf.cs.meta | 12 + .../Bindings/TestToPrefabResource/Norf2.cs | 10 + .../TestToPrefabResource/Norf2.cs.meta | 12 + .../Bindings/TestToPrefabResource/Qux.cs | 17 ++ .../Bindings/TestToPrefabResource/Qux.cs.meta | 12 + .../TestToPrefabResource/Resources.meta | 9 + .../Resources/TestToPrefabResource.meta | 9 + .../Resources/TestToPrefabResource/Foo.prefab | 64 ++++++ .../TestToPrefabResource/Foo.prefab.meta | 8 + .../TestToPrefabResource/Foo2.prefab | 52 +++++ .../TestToPrefabResource/Foo2.prefab.meta | 8 + .../TestToPrefabResource/GorpAndQux.prefab | 64 ++++++ .../GorpAndQux.prefab.meta | 8 + .../TestToPrefabResource/JimAndBob.prefab | 64 ++++++ .../JimAndBob.prefab.meta | 8 + .../TestToPrefabResource/Norf.prefab | 76 +++++++ .../TestToPrefabResource/Norf.prefab.meta | 8 + .../TestToPrefabResource.unity | 155 +++++++++++++ .../TestToPrefabResource.unity.meta | 8 + .../Bindings/TestToResource.meta | 9 + .../Bindings/TestToResource/Fixture.cs | 91 ++++++++ .../Bindings/TestToResource/Fixture.cs.meta | 12 + .../Bindings/TestToResource/Resources.meta | 9 + .../Resources/TestToResource.meta | 9 + .../Resources/TestToResource/TestTexture.png | Bin 0 -> 13429 bytes .../TestToResource/TestTexture.png.meta | 57 +++++ .../Resources/TestToResource/TestTexture2.png | Bin 0 -> 17128 bytes .../TestToResource/TestTexture2.png.meta | 57 +++++ .../TestToResource/TestToResource.unity | 155 +++++++++++++ .../TestToResource/TestToResource.unity.meta | 8 + .../Bindings/TestToSubContainerPrefab.meta | 9 + .../Bindings/TestToSubContainerPrefab/Bar.cs | 9 + .../TestToSubContainerPrefab/Bar.cs.meta | 12 + .../TestToSubContainerPrefab/Fixture.cs | 185 +++++++++++++++ .../TestToSubContainerPrefab/Fixture.cs.meta | 12 + .../Bindings/TestToSubContainerPrefab/Foo.cs | 12 + .../TestToSubContainerPrefab/Foo.cs.meta | 12 + .../TestToSubContainerPrefab/Foo.prefab | 139 ++++++++++++ .../TestToSubContainerPrefab/Foo.prefab.meta | 8 + .../TestToSubContainerPrefab/FooInstaller.cs | 18 ++ .../FooInstaller.cs.meta | 12 + .../Bindings/TestToSubContainerPrefab/Gorp.cs | 9 + .../TestToSubContainerPrefab/Gorp.cs.meta | 12 + .../TestToSubContainerPrefab.unity | 156 +++++++++++++ .../TestToSubContainerPrefab.unity.meta | 8 + .../TestToSubContainerPrefabResource.meta | 9 + .../TestToSubContainerPrefabResource/Bar.cs | 9 + .../Bar.cs.meta | 12 + .../Fixture.cs | 195 ++++++++++++++++ .../Fixture.cs.meta | 12 + .../TestToSubContainerPrefabResource/Foo.cs | 12 + .../Foo.cs.meta | 12 + .../FooInstaller.cs | 18 ++ .../FooInstaller.cs.meta | 12 + .../TestToSubContainerPrefabResource/Gorp.cs | 9 + .../Gorp.cs.meta | 12 + .../Resources.meta | 9 + .../ToSubContainerPrefabResource.meta | 9 + .../FooSubContainer.prefab | 139 ++++++++++++ .../FooSubContainer.prefab.meta | 8 + .../TestToSubContainerPrefabResource.unity | 155 +++++++++++++ ...estToSubContainerPrefabResource.unity.meta | 8 + .../IntegrationTests/Factories.meta | 9 + .../Factories/PrefabFactory.meta | 9 + .../Factories/PrefabFactory/Fixture.cs | 43 ++++ .../Factories/PrefabFactory/Fixture.cs.meta | 12 + .../Factories/PrefabFactory/Foo.cs | 17 ++ .../Factories/PrefabFactory/Foo.cs.meta | 12 + .../Factories/PrefabFactory/Foo.prefab | 53 +++++ .../Factories/PrefabFactory/Foo.prefab.meta | 8 + .../PrefabFactory/TestPrefabFactory.unity | 156 +++++++++++++ .../TestPrefabFactory.unity.meta | 8 + .../Factories/TestBindFactory.meta | 9 + .../Factories/TestBindFactory/Fixture.cs | 214 ++++++++++++++++++ .../Factories/TestBindFactory/Fixture.cs.meta | 12 + .../Factories/TestBindFactory/Foo.cs | 20 ++ .../Factories/TestBindFactory/Foo.cs.meta | 12 + .../Factories/TestBindFactory/Resources.meta | 9 + .../Resources/TestBindFactory.meta | 9 + .../Resources/TestBindFactory/Foo.prefab | 52 +++++ .../Resources/TestBindFactory/Foo.prefab.meta | 8 + .../TestBindFactory/FooSubContainer.prefab | 113 +++++++++ .../FooSubContainer.prefab.meta | 8 + .../Resources/TestBindFactory/TestTexture.png | Bin 0 -> 13429 bytes .../TestBindFactory/TestTexture.png.meta | 57 +++++ .../TestBindFactory/TestBindFactory.unity | 158 +++++++++++++ .../TestBindFactory.unity.meta | 8 + .../Factories/TestBindFactoryFive.meta | 9 + .../Factories/TestBindFactoryFive/Fixture.cs | 185 +++++++++++++++ .../TestBindFactoryFive/Fixture.cs.meta | 12 + .../Factories/TestBindFactoryFive/Foo.cs | 36 +++ .../Factories/TestBindFactoryFive/Foo.cs.meta | 12 + .../TestBindFactoryFive/FooInstaller.cs | 35 +++ .../TestBindFactoryFive/FooInstaller.cs.meta | 12 + .../TestBindFactoryFive/Resources.meta | 9 + .../Resources/TestBindFactoryFive.meta | 9 + .../Resources/TestBindFactoryFive/Foo.prefab | 52 +++++ .../TestBindFactoryFive/Foo.prefab.meta | 8 + .../FooSubContainer.prefab | 69 ++++++ .../FooSubContainer.prefab.meta | 8 + .../TestBindFactoryFive.unity | 158 +++++++++++++ .../TestBindFactoryFive.unity.meta | 8 + .../Factories/TestBindFactoryOne.meta | 9 + .../Factories/TestBindFactoryOne/Fixture.cs | 184 +++++++++++++++ .../TestBindFactoryOne/Fixture.cs.meta | 12 + .../Factories/TestBindFactoryOne/Foo.cs | 36 +++ .../Factories/TestBindFactoryOne/Foo.cs.meta | 12 + .../TestBindFactoryOne/FooInstaller.cs | 22 ++ .../TestBindFactoryOne/FooInstaller.cs.meta | 12 + .../TestBindFactoryOne/Resources.meta | 9 + .../Resources/TestBindFactoryOne.meta | 9 + .../Resources/TestBindFactoryOne/Foo.prefab | 52 +++++ .../TestBindFactoryOne/Foo.prefab.meta | 8 + .../TestBindFactoryOne/FooSubContainer.prefab | 69 ++++++ .../FooSubContainer.prefab.meta | 8 + .../TestBindFactoryOne.unity | 158 +++++++++++++ .../TestBindFactoryOne.unity.meta | 8 + .../Factories/TestGameObjectFactory.meta | 9 + .../TestGameObjectFactory/OneParam.meta | 9 + .../TestGameObjectFactory/OneParam/Fixture.cs | 111 +++++++++ .../OneParam/Fixture.cs.meta | 12 + .../TestGameObjectFactory/OneParam/Foo.cs | 20 ++ .../OneParam/Foo.cs.meta | 12 + .../OneParam/Resources.meta | 9 + .../Resources/TestGameObjectFactoryOne.meta | 9 + .../TestGameObjectFactoryOne/Cube.prefab | 100 ++++++++ .../TestGameObjectFactoryOne/Cube.prefab.meta | 8 + .../TestGameObjectFactoryOneParams.unity | 156 +++++++++++++ .../TestGameObjectFactoryOneParams.unity.meta | 8 + .../TestGameObjectFactory/ZeroParams.meta | 9 + .../ZeroParams/Fixture.cs | 90 ++++++++ .../ZeroParams/Fixture.cs.meta | 12 + .../ZeroParams/Resources.meta | 9 + .../Resources/TestGameObjectFactory.meta | 9 + .../TestGameObjectFactory/Cube.prefab | 88 +++++++ .../TestGameObjectFactory/Cube.prefab.meta | 8 + .../TestGameObjectFactoryZeroParams.unity | 156 +++++++++++++ ...TestGameObjectFactoryZeroParams.unity.meta | 8 + .../IntegrationTests/Runner.meta | 9 + .../Runner/MonoTestFixture.cs | 16 ++ .../Runner/MonoTestFixture.cs.meta | 12 + .../IntegrationTests/Runner/TestAttribute.cs | 19 ++ .../Runner/TestAttribute.cs.meta | 12 + .../Runner/UnityUnitTestMultiRunner.cs | 196 ++++++++++++++++ .../Runner/UnityUnitTestMultiRunner.cs.meta | 12 + .../Runner/UnityUnitTestRunner.cs | 52 +++++ .../Runner/UnityUnitTestRunner.cs.meta | 12 + .../UnityUnitTestSingleRunnerInstaller.cs | 57 +++++ ...UnityUnitTestSingleRunnerInstaller.cs.meta | 12 + .../OptionalExtras/IntegrationTests/Util.meta | 9 + .../Util/ComponentCountAsserter.cs | 32 +++ .../Util/ComponentCountAsserter.cs.meta | 12 + .../IntegrationTests/Util/FactoryUser.cs | 24 ++ .../IntegrationTests/Util/FactoryUser.cs.meta | 12 + .../IntegrationTests/Util/FixtureUtil.cs | 67 ++++++ .../IntegrationTests/Util/FixtureUtil.cs.meta | 12 + .../Util/GameObjectCountAsserter.cs | 28 +++ .../Util/GameObjectCountAsserter.cs.meta | 12 + .../Util/GameObjectNameCountAsserter.cs | 36 +++ .../Util/GameObjectNameCountAsserter.cs.meta | 12 + .../Util/InitMethodHandler.cs | 61 +++++ .../Util/InitMethodHandler.cs.meta | 12 + .../Util/ResolveCountAsserter.cs | 32 +++ .../Util/ResolveCountAsserter.cs.meta | 12 + 233 files changed, 8503 insertions(+), 2 deletions(-) create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests.meta create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings.meta create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/BindGameObject.meta create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/BindGameObject/BindGameObject.unity rename UnityProject/Assets/Zenject/{Source/Usage/Mtm.Zenject-usage.csproj.meta => OptionalExtras/IntegrationTests/Bindings/BindGameObject/BindGameObject.unity.meta} (63%) create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/BindGameObject/Fixture.cs create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/BindGameObject/Fixture.cs.meta create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/BindGameObject/Resources.meta create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/BindGameObject/Resources/BindGameObject.meta create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/BindGameObject/Resources/BindGameObject/Cube.prefab create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/BindGameObject/Resources/BindGameObject/Cube.prefab.meta create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToGameObject.meta create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToGameObject/Fixture.cs create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToGameObject/Fixture.cs.meta create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToGameObject/TestToGameObject.unity create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToGameObject/TestToGameObject.unity.meta create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToMonoBehaviour.meta create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToMonoBehaviour/Fixture.cs create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToMonoBehaviour/Fixture.cs.meta create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToMonoBehaviour/Foo.cs create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToMonoBehaviour/Foo.cs.meta create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToMonoBehaviour/TestToMonoBehaviour.unity create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToMonoBehaviour/TestToMonoBehaviour.unity.meta create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefab.meta create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefab/Bar.cs create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefab/Bar.cs.meta create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefab/Bob.cs create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefab/Bob.cs.meta create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefab/Fixture.cs create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefab/Fixture.cs.meta create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefab/Foo.cs create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefab/Foo.cs.meta create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefab/Foo.prefab create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefab/Foo.prefab.meta create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefab/Foo2.prefab create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefab/Foo2.prefab.meta create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefab/Gorp.cs create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefab/Gorp.cs.meta create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefab/Jim.cs create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefab/Jim.cs.meta create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefab/JimAndBob.prefab create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefab/JimAndBob.prefab.meta create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefab/Norf.cs create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefab/Norf.cs.meta create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefab/Norf.prefab create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefab/Norf.prefab.meta create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefab/Norf2.cs create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefab/Norf2.cs.meta create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefab/Qux.cs create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefab/Qux.cs.meta create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefab/QuxAndGorp.prefab create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefab/QuxAndGorp.prefab.meta create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefab/TestToPrefab.unity create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefab/TestToPrefab.unity.meta create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefabResource.meta create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefabResource/Bar.cs create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefabResource/Bar.cs.meta create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefabResource/Bob.cs create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefabResource/Bob.cs.meta create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefabResource/Fixture.cs create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefabResource/Fixture.cs.meta create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefabResource/Foo.cs create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefabResource/Foo.cs.meta create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefabResource/Gorp.cs create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefabResource/Gorp.cs.meta create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefabResource/Jim.cs create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefabResource/Jim.cs.meta create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefabResource/Norf.cs create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefabResource/Norf.cs.meta create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefabResource/Norf2.cs create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefabResource/Norf2.cs.meta create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefabResource/Qux.cs create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefabResource/Qux.cs.meta create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefabResource/Resources.meta create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefabResource/Resources/TestToPrefabResource.meta create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefabResource/Resources/TestToPrefabResource/Foo.prefab create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefabResource/Resources/TestToPrefabResource/Foo.prefab.meta create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefabResource/Resources/TestToPrefabResource/Foo2.prefab create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefabResource/Resources/TestToPrefabResource/Foo2.prefab.meta create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefabResource/Resources/TestToPrefabResource/GorpAndQux.prefab create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefabResource/Resources/TestToPrefabResource/GorpAndQux.prefab.meta create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefabResource/Resources/TestToPrefabResource/JimAndBob.prefab create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefabResource/Resources/TestToPrefabResource/JimAndBob.prefab.meta create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefabResource/Resources/TestToPrefabResource/Norf.prefab create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefabResource/Resources/TestToPrefabResource/Norf.prefab.meta create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefabResource/TestToPrefabResource.unity create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefabResource/TestToPrefabResource.unity.meta create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToResource.meta create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToResource/Fixture.cs create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToResource/Fixture.cs.meta create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToResource/Resources.meta create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToResource/Resources/TestToResource.meta create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToResource/Resources/TestToResource/TestTexture.png create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToResource/Resources/TestToResource/TestTexture.png.meta create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToResource/Resources/TestToResource/TestTexture2.png create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToResource/Resources/TestToResource/TestTexture2.png.meta create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToResource/TestToResource.unity create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToResource/TestToResource.unity.meta create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToSubContainerPrefab.meta create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToSubContainerPrefab/Bar.cs create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToSubContainerPrefab/Bar.cs.meta create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToSubContainerPrefab/Fixture.cs create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToSubContainerPrefab/Fixture.cs.meta create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToSubContainerPrefab/Foo.cs create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToSubContainerPrefab/Foo.cs.meta create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToSubContainerPrefab/Foo.prefab create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToSubContainerPrefab/Foo.prefab.meta create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToSubContainerPrefab/FooInstaller.cs create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToSubContainerPrefab/FooInstaller.cs.meta create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToSubContainerPrefab/Gorp.cs create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToSubContainerPrefab/Gorp.cs.meta create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToSubContainerPrefab/TestToSubContainerPrefab.unity create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToSubContainerPrefab/TestToSubContainerPrefab.unity.meta create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToSubContainerPrefabResource.meta create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToSubContainerPrefabResource/Bar.cs create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToSubContainerPrefabResource/Bar.cs.meta create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToSubContainerPrefabResource/Fixture.cs create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToSubContainerPrefabResource/Fixture.cs.meta create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToSubContainerPrefabResource/Foo.cs create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToSubContainerPrefabResource/Foo.cs.meta create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToSubContainerPrefabResource/FooInstaller.cs create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToSubContainerPrefabResource/FooInstaller.cs.meta create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToSubContainerPrefabResource/Gorp.cs create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToSubContainerPrefabResource/Gorp.cs.meta create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToSubContainerPrefabResource/Resources.meta create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToSubContainerPrefabResource/Resources/ToSubContainerPrefabResource.meta create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToSubContainerPrefabResource/Resources/ToSubContainerPrefabResource/FooSubContainer.prefab create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToSubContainerPrefabResource/Resources/ToSubContainerPrefabResource/FooSubContainer.prefab.meta create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToSubContainerPrefabResource/TestToSubContainerPrefabResource.unity create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToSubContainerPrefabResource/TestToSubContainerPrefabResource.unity.meta create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories.meta create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/PrefabFactory.meta create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/PrefabFactory/Fixture.cs create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/PrefabFactory/Fixture.cs.meta create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/PrefabFactory/Foo.cs create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/PrefabFactory/Foo.cs.meta create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/PrefabFactory/Foo.prefab create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/PrefabFactory/Foo.prefab.meta create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/PrefabFactory/TestPrefabFactory.unity create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/PrefabFactory/TestPrefabFactory.unity.meta create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactory.meta create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactory/Fixture.cs create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactory/Fixture.cs.meta create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactory/Foo.cs create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactory/Foo.cs.meta create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactory/Resources.meta create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactory/Resources/TestBindFactory.meta create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactory/Resources/TestBindFactory/Foo.prefab create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactory/Resources/TestBindFactory/Foo.prefab.meta create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactory/Resources/TestBindFactory/FooSubContainer.prefab create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactory/Resources/TestBindFactory/FooSubContainer.prefab.meta create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactory/Resources/TestBindFactory/TestTexture.png create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactory/Resources/TestBindFactory/TestTexture.png.meta create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactory/TestBindFactory.unity create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactory/TestBindFactory.unity.meta create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactoryFive.meta create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactoryFive/Fixture.cs create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactoryFive/Fixture.cs.meta create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactoryFive/Foo.cs create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactoryFive/Foo.cs.meta create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactoryFive/FooInstaller.cs create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactoryFive/FooInstaller.cs.meta create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactoryFive/Resources.meta create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactoryFive/Resources/TestBindFactoryFive.meta create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactoryFive/Resources/TestBindFactoryFive/Foo.prefab create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactoryFive/Resources/TestBindFactoryFive/Foo.prefab.meta create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactoryFive/Resources/TestBindFactoryFive/FooSubContainer.prefab create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactoryFive/Resources/TestBindFactoryFive/FooSubContainer.prefab.meta create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactoryFive/TestBindFactoryFive.unity create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactoryFive/TestBindFactoryFive.unity.meta create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactoryOne.meta create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactoryOne/Fixture.cs create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactoryOne/Fixture.cs.meta create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactoryOne/Foo.cs create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactoryOne/Foo.cs.meta create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactoryOne/FooInstaller.cs create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactoryOne/FooInstaller.cs.meta create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactoryOne/Resources.meta create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactoryOne/Resources/TestBindFactoryOne.meta create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactoryOne/Resources/TestBindFactoryOne/Foo.prefab create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactoryOne/Resources/TestBindFactoryOne/Foo.prefab.meta create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactoryOne/Resources/TestBindFactoryOne/FooSubContainer.prefab create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactoryOne/Resources/TestBindFactoryOne/FooSubContainer.prefab.meta create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactoryOne/TestBindFactoryOne.unity create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactoryOne/TestBindFactoryOne.unity.meta create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestGameObjectFactory.meta create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestGameObjectFactory/OneParam.meta create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestGameObjectFactory/OneParam/Fixture.cs create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestGameObjectFactory/OneParam/Fixture.cs.meta create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestGameObjectFactory/OneParam/Foo.cs create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestGameObjectFactory/OneParam/Foo.cs.meta create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestGameObjectFactory/OneParam/Resources.meta create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestGameObjectFactory/OneParam/Resources/TestGameObjectFactoryOne.meta create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestGameObjectFactory/OneParam/Resources/TestGameObjectFactoryOne/Cube.prefab create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestGameObjectFactory/OneParam/Resources/TestGameObjectFactoryOne/Cube.prefab.meta create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestGameObjectFactory/OneParam/TestGameObjectFactoryOneParams.unity create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestGameObjectFactory/OneParam/TestGameObjectFactoryOneParams.unity.meta create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestGameObjectFactory/ZeroParams.meta create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestGameObjectFactory/ZeroParams/Fixture.cs create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestGameObjectFactory/ZeroParams/Fixture.cs.meta create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestGameObjectFactory/ZeroParams/Resources.meta create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestGameObjectFactory/ZeroParams/Resources/TestGameObjectFactory.meta create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestGameObjectFactory/ZeroParams/Resources/TestGameObjectFactory/Cube.prefab create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestGameObjectFactory/ZeroParams/Resources/TestGameObjectFactory/Cube.prefab.meta create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestGameObjectFactory/ZeroParams/TestGameObjectFactoryZeroParams.unity create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestGameObjectFactory/ZeroParams/TestGameObjectFactoryZeroParams.unity.meta create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Runner.meta create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Runner/MonoTestFixture.cs create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Runner/MonoTestFixture.cs.meta create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Runner/TestAttribute.cs create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Runner/TestAttribute.cs.meta create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Runner/UnityUnitTestMultiRunner.cs create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Runner/UnityUnitTestMultiRunner.cs.meta create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Runner/UnityUnitTestRunner.cs create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Runner/UnityUnitTestRunner.cs.meta create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Runner/UnityUnitTestSingleRunnerInstaller.cs create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Runner/UnityUnitTestSingleRunnerInstaller.cs.meta create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Util.meta create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Util/ComponentCountAsserter.cs create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Util/ComponentCountAsserter.cs.meta create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Util/FactoryUser.cs create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Util/FactoryUser.cs.meta create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Util/FixtureUtil.cs create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Util/FixtureUtil.cs.meta create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Util/GameObjectCountAsserter.cs create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Util/GameObjectCountAsserter.cs.meta create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Util/GameObjectNameCountAsserter.cs create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Util/GameObjectNameCountAsserter.cs.meta create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Util/InitMethodHandler.cs create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Util/InitMethodHandler.cs.meta create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Util/ResolveCountAsserter.cs create mode 100644 UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Util/ResolveCountAsserter.cs.meta diff --git a/Build/python/mtm/zen/CreateRelease.py b/Build/python/mtm/zen/CreateRelease.py index a4f2049c0..577dc1d78 100644 --- a/Build/python/mtm/zen/CreateRelease.py +++ b/Build/python/mtm/zen/CreateRelease.py @@ -120,6 +120,10 @@ def _createCSharpPackage(self, includeSample, outputPath): self._sys.deleteDirectory('[ZenTempDir]/OptionalExtras/UnitTests') self._sys.removeFile('[ZenTempDir]/OptionalExtras/UnitTests.meta') + self._zipHelper.createZipFile('[ZenTempDir]/OptionalExtras/IntegrationTests', '[ZenTempDir]/OptionalExtras/IntegrationTests.zip') + self._sys.deleteDirectory('[ZenTempDir]/OptionalExtras/IntegrationTests') + self._sys.removeFile('[ZenTempDir]/OptionalExtras/IntegrationTests.meta') + self._zipHelper.createZipFile('[ZenTempDir]/OptionalExtras/AutoMocking', '[ZenTempDir]/OptionalExtras/AutoMocking.zip') self._sys.deleteDirectory('[ZenTempDir]/OptionalExtras/AutoMocking') self._sys.removeFile('[ZenTempDir]/OptionalExtras/AutoMocking.meta') diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests.meta b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests.meta new file mode 100644 index 000000000..f8a62f6cd --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: f8d518813058ccd4c8ce2eb0a99748b5 +folderAsset: yes +timeCreated: 1462057592 +licenseType: Pro +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings.meta b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings.meta new file mode 100644 index 000000000..f0036cab7 --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 3721bff4b7d518847bbb1d65ba04a06f +folderAsset: yes +timeCreated: 1462057592 +licenseType: Pro +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/BindGameObject.meta b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/BindGameObject.meta new file mode 100644 index 000000000..9b7408c0d --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/BindGameObject.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 652b62ec6dbe8894e9208457a375f1b6 +folderAsset: yes +timeCreated: 1459194355 +licenseType: Pro +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/BindGameObject/BindGameObject.unity b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/BindGameObject/BindGameObject.unity new file mode 100644 index 000000000..f959e7e82 --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/BindGameObject/BindGameObject.unity @@ -0,0 +1,156 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!29 &1 +SceneSettings: + m_ObjectHideFlags: 0 + m_PVSData: + m_PVSObjectsArray: [] + m_PVSPortalsArray: [] + m_OcclusionBakeSettings: + smallestOccluder: 5 + smallestHole: 0.25 + backfaceThreshold: 100 +--- !u!104 &2 +RenderSettings: + m_ObjectHideFlags: 0 + serializedVersion: 6 + m_Fog: 0 + m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} + m_FogMode: 3 + m_FogDensity: 0.01 + m_LinearFogStart: 0 + m_LinearFogEnd: 300 + m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} + m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} + m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} + m_AmbientIntensity: 1 + m_AmbientMode: 0 + m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0} + m_HaloStrength: 0.5 + m_FlareStrength: 1 + m_FlareFadeSpeed: 3 + m_HaloTexture: {fileID: 0} + m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} + m_DefaultReflectionMode: 0 + m_DefaultReflectionResolution: 128 + m_ReflectionBounces: 1 + m_ReflectionIntensity: 1 + m_CustomReflection: {fileID: 0} + m_Sun: {fileID: 0} +--- !u!157 &3 +LightmapSettings: + m_ObjectHideFlags: 0 + serializedVersion: 6 + m_GIWorkflowMode: 0 + m_LightmapsMode: 1 + m_GISettings: + serializedVersion: 2 + m_BounceScale: 1 + m_IndirectOutputScale: 1 + m_AlbedoBoost: 1 + m_TemporalCoherenceThreshold: 1 + m_EnvironmentLightingMode: 0 + m_EnableBakedLightmaps: 1 + m_EnableRealtimeLightmaps: 1 + m_LightmapEditorSettings: + serializedVersion: 3 + m_Resolution: 2 + m_BakeResolution: 40 + m_TextureWidth: 1024 + m_TextureHeight: 1024 + m_AOMaxDistance: 1 + m_Padding: 2 + m_CompAOExponent: 0 + m_LightmapParameters: {fileID: 0} + m_TextureCompression: 1 + m_FinalGather: 0 + m_FinalGatherRayCount: 1024 + m_ReflectionCompression: 2 + m_LightingDataAsset: {fileID: 0} + m_RuntimeCPUUsage: 25 +--- !u!196 &4 +NavMeshSettings: + serializedVersion: 2 + m_ObjectHideFlags: 0 + m_BuildSettings: + serializedVersion: 2 + agentRadius: 0.5 + agentHeight: 2 + agentSlope: 45 + agentClimb: 0.4 + ledgeDropHeight: 0 + maxJumpAcrossDistance: 0 + accuratePlacement: 0 + minRegionArea: 2 + cellSize: 0.16666667 + manualCellSize: 0 + m_NavMeshData: {fileID: 0} +--- !u!1 &978433746 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 4 + m_Component: + - 4: {fileID: 978433749} + - 114: {fileID: 978433747} + - 114: {fileID: 978433750} + m_Layer: 0 + m_Name: SceneCompositionRoot + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &978433747 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 978433746} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 0e516af87ca41694bbaa70c373f993e0, type: 3} + m_Name: + m_EditorClassIdentifier: + _runAll: 1 + _testMethod: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 978433750} + m_MethodName: TestGameObjectConcreteSingle + m_Mode: 1 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 1 + m_TypeName: UnityEngine.Events.UnityEvent, UnityEngine, Version=0.0.0.0, Culture=neutral, + PublicKeyToken=null +--- !u!4 &978433749 +Transform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 978433746} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 +--- !u!114 &978433750 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 978433746} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: b2a4b96e29add784fad9924f51f7fa9b, type: 3} + m_Name: + m_EditorClassIdentifier: + CubePrefab: {fileID: 181248, guid: 16c31656842de3b429a3232daac6826c, type: 2} diff --git a/UnityProject/Assets/Zenject/Source/Usage/Mtm.Zenject-usage.csproj.meta b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/BindGameObject/BindGameObject.unity.meta similarity index 63% rename from UnityProject/Assets/Zenject/Source/Usage/Mtm.Zenject-usage.csproj.meta rename to UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/BindGameObject/BindGameObject.unity.meta index 7510259ac..5d328b606 100644 --- a/UnityProject/Assets/Zenject/Source/Usage/Mtm.Zenject-usage.csproj.meta +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/BindGameObject/BindGameObject.unity.meta @@ -1,6 +1,6 @@ fileFormatVersion: 2 -guid: b424282072f5bef469dc8603115d607e -timeCreated: 1461724877 +guid: c21e951b139b8d24d9f719d7a1045f8b +timeCreated: 1459194367 licenseType: Pro DefaultImporter: userData: diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/BindGameObject/Fixture.cs b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/BindGameObject/Fixture.cs new file mode 100644 index 000000000..e849752ad --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/BindGameObject/Fixture.cs @@ -0,0 +1,132 @@ +using System; +using System.Collections.Generic; +using ModestTree.UnityUnitTester; +using UnityEngine; + +namespace ModestTree.Tests.Zenject.BindGameObject +{ + public class Fixture : MonoTestFixture + { + public GameObject CubePrefab; + + const string GameObjName = "TestObj"; + + [Test] + public void TestGameObjectSelfSingle1() + { + Container.Bind().FromGameObject().WithGameObjectName(GameObjName).AsSingle(); + + Container.BindRootResolve(); + + FixtureUtil.AssertNumGameObjects(Container, 1); + FixtureUtil.AssertNumGameObjectsWithName(Container, GameObjName, 1); + } + + [Test] + public void TestGameObjectSelfSingle2() + { + Container.Bind().FromGameObject().WithGameObjectName(GameObjName).AsSingle(); + Container.Bind().FromGameObject().WithGameObjectName(GameObjName).AsSingle(); + Container.Bind("asdf").FromGameObject().WithGameObjectName(GameObjName).AsSingle(); + + Container.BindRootResolve(); + Container.BindRootResolve("asdf"); + + FixtureUtil.AssertNumGameObjects(Container, 1); + FixtureUtil.AssertNumGameObjectsWithName(Container, GameObjName, 1); + } + + [Test] + [ExpectedException] + [ExpectedValidationException] + public void TestGameObjectSelfSingleConflict() + { + Container.Bind().FromGameObject().WithGameObjectName(GameObjName).AsSingle(); + Container.Bind().FromGameObject().WithGameObjectName("asdf").AsSingle(); + + Container.BindRootResolve(); + } + + [Test] + public void TestGameObjectSelfTransient() + { + Container.Bind().FromGameObject().WithGameObjectName(GameObjName).AsTransient(); + Container.Bind().FromGameObject().WithGameObjectName(GameObjName).AsTransient(); + Container.Bind().FromGameObject().WithGameObjectName("asdf").AsTransient(); + Container.BindRootResolve(); + + FixtureUtil.AssertNumGameObjects(Container, 3); + FixtureUtil.AssertNumGameObjectsWithName(Container, GameObjName, 2); + } + + [Test] + public void TestGameObjectConcreteSingle() + { + Container.Bind().To().FromGameObject().WithGameObjectName(GameObjName).AsSingle(); + + Container.BindRootResolve(); + + FixtureUtil.AssertNumGameObjects(Container, 1); + FixtureUtil.AssertNumGameObjectsWithName(Container, GameObjName, 1); + } + + [Test] + public void TestPrefabSelfSingle1() + { + Container.Bind().FromPrefab(CubePrefab) + .WithGameObjectName(GameObjName).AsSingle(); + + FixtureUtil.AssertNumGameObjects(Container, 1); + FixtureUtil.AssertNumGameObjectsWithName(Container, GameObjName, 1); + + FixtureUtil.AddInitMethod(Container, (GameObject gameObject) => + { + Assert.IsNotNull(gameObject.GetComponent()); + }); + } + + [Test] + public void TestPrefabConcreteSingle1() + { + Container.Bind().To() + .FromPrefab(CubePrefab).WithGameObjectName(GameObjName).AsSingle(); + + FixtureUtil.AssertNumGameObjects(Container, 1); + FixtureUtil.AssertNumGameObjectsWithName(Container, GameObjName, 1); + + FixtureUtil.AddInitMethod(Container, (UnityEngine.Object obj) => + { + Assert.IsNotNull(((GameObject)obj).GetComponent()); + }); + } + + [Test] + public void TestPrefabResourceSelfSingle1() + { + Container.Bind().FromPrefabResource("BindGameObject/Cube").WithGameObjectName(GameObjName).AsSingle(); + + FixtureUtil.AssertNumGameObjects(Container, 1); + FixtureUtil.AssertNumGameObjectsWithName(Container, GameObjName, 1); + + FixtureUtil.AddInitMethod(Container, (GameObject gameObject) => + { + Assert.IsNotNull(gameObject.GetComponent()); + }); + } + + [Test] + public void TestPrefabResourceConcreteSingle1() + { + Container.Bind().To() + .FromPrefabResource("BindGameObject/Cube").WithGameObjectName(GameObjName).AsSingle(); + + FixtureUtil.AssertNumGameObjects(Container, 1); + FixtureUtil.AssertNumGameObjectsWithName(Container, GameObjName, 1); + + FixtureUtil.AddInitMethod(Container, (UnityEngine.Object obj) => + { + Assert.IsNotNull(((GameObject)obj).GetComponent()); + }); + } + } +} diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/BindGameObject/Fixture.cs.meta b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/BindGameObject/Fixture.cs.meta new file mode 100644 index 000000000..383ac8f48 --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/BindGameObject/Fixture.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: b2a4b96e29add784fad9924f51f7fa9b +timeCreated: 1459194367 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/BindGameObject/Resources.meta b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/BindGameObject/Resources.meta new file mode 100644 index 000000000..b43e52afd --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/BindGameObject/Resources.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 9b75849eaa1ecbb4bbe5b7b32c944224 +folderAsset: yes +timeCreated: 1459212986 +licenseType: Pro +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/BindGameObject/Resources/BindGameObject.meta b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/BindGameObject/Resources/BindGameObject.meta new file mode 100644 index 000000000..f065379fa --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/BindGameObject/Resources/BindGameObject.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: b0648c2df4fbcca4388759ece4a4ef01 +folderAsset: yes +timeCreated: 1459212995 +licenseType: Pro +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/BindGameObject/Resources/BindGameObject/Cube.prefab b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/BindGameObject/Resources/BindGameObject/Cube.prefab new file mode 100644 index 000000000..6334ed628 --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/BindGameObject/Resources/BindGameObject/Cube.prefab @@ -0,0 +1,88 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &181248 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 4: {fileID: 496296} + - 33: {fileID: 3312568} + - 65: {fileID: 6582216} + - 23: {fileID: 2356458} + m_Layer: 0 + m_Name: Cube + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &496296 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 181248} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 +--- !u!23 &2356458 +MeshRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 181248} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_Materials: + - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + m_SubsetIndices: + m_StaticBatchRoot: {fileID: 0} + m_UseLightProbes: 1 + m_ReflectionProbeUsage: 1 + m_ProbeAnchor: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 1 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingOrder: 0 +--- !u!33 &3312568 +MeshFilter: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 181248} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!65 &6582216 +BoxCollider: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 181248} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Size: {x: 1, y: 1, z: 1} + m_Center: {x: 0, y: 0, z: 0} +--- !u!1001 &100100000 +Prefab: + m_ObjectHideFlags: 1 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: [] + m_RemovedComponents: [] + m_ParentPrefab: {fileID: 0} + m_RootGameObject: {fileID: 181248} + m_IsPrefabParent: 1 diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/BindGameObject/Resources/BindGameObject/Cube.prefab.meta b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/BindGameObject/Resources/BindGameObject/Cube.prefab.meta new file mode 100644 index 000000000..9530216ca --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/BindGameObject/Resources/BindGameObject/Cube.prefab.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 16c31656842de3b429a3232daac6826c +timeCreated: 1459207171 +licenseType: Pro +NativeFormatImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToGameObject.meta b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToGameObject.meta new file mode 100644 index 000000000..6f7b131ef --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToGameObject.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 19ae9275b4e016a4e86f258a85ed8ee5 +folderAsset: yes +timeCreated: 1458174609 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToGameObject/Fixture.cs b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToGameObject/Fixture.cs new file mode 100644 index 000000000..bc11a3e48 --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToGameObject/Fixture.cs @@ -0,0 +1,143 @@ +using System; +using System.Collections.Generic; +using ModestTree.UnityUnitTester; +using UnityEngine; +using Zenject; + +namespace ModestTree.Tests.Zenject.ToGameObject +{ + public class Fixture : MonoTestFixture + { + const string GameObjName = "TestObj"; + + [Test] + public void TestBasic() + { + Container.Bind().FromGameObject().WithGameObjectName(GameObjName).AsSingle(); + Container.BindRootResolve(); + + FixtureUtil.AssertNumGameObjects(Container, 1); + FixtureUtil.AssertComponentCount(Container, 1); + } + + [Test] + public void TestSingle() + { + Container.Bind().FromGameObject().WithGameObjectName(GameObjName).AsSingle(); + Container.Bind().To().FromGameObject().WithGameObjectName(GameObjName).AsSingle(); + + Container.BindRootResolve(); + Container.BindRootResolve(); + + FixtureUtil.AssertNumGameObjects(Container, 1); + FixtureUtil.AssertComponentCount(Container, 1); + } + + [Test] + public void TestTransient() + { + Container.Bind().FromGameObject().WithGameObjectName(GameObjName).AsTransient(); + Container.Bind().To().FromGameObject().WithGameObjectName(GameObjName).AsTransient(); + + Container.BindRootResolve(); + Container.BindRootResolve(); + + FixtureUtil.AssertNumGameObjects(Container, 2); + FixtureUtil.AssertComponentCount(Container, 2); + } + + [Test] + public void TestCached1() + { + Container.Bind().FromGameObject().WithGameObjectName(GameObjName).AsCached(); + Container.Bind().To().FromGameObject().WithGameObjectName(GameObjName).AsCached(); + + Container.BindRootResolve(); + Container.BindRootResolve(); + + FixtureUtil.AssertNumGameObjects(Container, 2); + FixtureUtil.AssertComponentCount(Container, 2); + } + + [Test] + public void TestCached2() + { + Container.Bind(typeof(Foo), typeof(IFoo)).To().FromGameObject().WithGameObjectName(GameObjName).AsCached(); + + Container.BindRootResolve(); + Container.BindRootResolve(); + + FixtureUtil.AssertNumGameObjects(Container, 1); + FixtureUtil.AssertComponentCount(Container, 1); + } + + [Test] + public void TestMultipleConcreteTransient1() + { + Container.Bind().To(typeof(Foo), typeof(Bar)).FromGameObject() + .WithGameObjectName(GameObjName); + + Container.BindRootResolve(); + + FixtureUtil.AssertNumGameObjects(Container, 2); + FixtureUtil.AssertComponentCount(Container, 1); + FixtureUtil.AssertComponentCount(Container, 1); + } + + [Test] + public void TestMultipleConcreteTransient2() + { + Container.Bind(typeof(IFoo), typeof(IBar)).To(new List() {typeof(Foo), typeof(Bar)}).FromGameObject() + .WithGameObjectName(GameObjName).AsTransient(); + + Container.BindRootResolve(); + Container.BindRootResolve(); + + FixtureUtil.AssertNumGameObjects(Container, 4); + FixtureUtil.AssertComponentCount(Container, 2); + FixtureUtil.AssertComponentCount(Container, 2); + } + + [Test] + public void TestMultipleConcreteCached() + { + Container.Bind(typeof(IFoo), typeof(IBar)).To(new List() {typeof(Foo), typeof(Bar)}).FromGameObject() + .WithGameObjectName(GameObjName).AsCached(); + + Container.BindRootResolve(); + Container.BindRootResolve(); + + FixtureUtil.AssertNumGameObjects(Container, 2); + FixtureUtil.AssertComponentCount(Container, 1); + FixtureUtil.AssertComponentCount(Container, 1); + } + + [Test] + public void TestMultipleConcreteSingle() + { + Container.Bind(typeof(IFoo), typeof(IBar)).To(new List() {typeof(Foo), typeof(Bar)}).FromGameObject() + .WithGameObjectName(GameObjName).AsSingle(); + + Container.BindRootResolve(); + Container.BindRootResolve(); + + FixtureUtil.AssertNumGameObjects(Container, 2); + } + + public interface IBar + { + } + + public interface IFoo + { + } + + public class Foo : MonoBehaviour, IFoo, IBar + { + } + + public class Bar : MonoBehaviour, IFoo, IBar + { + } + } +} diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToGameObject/Fixture.cs.meta b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToGameObject/Fixture.cs.meta new file mode 100644 index 000000000..cdcbe8ac0 --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToGameObject/Fixture.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 2deb5ef0bad19eb4985c9211357fd32f +timeCreated: 1454598516 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToGameObject/TestToGameObject.unity b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToGameObject/TestToGameObject.unity new file mode 100644 index 000000000..62b30f310 --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToGameObject/TestToGameObject.unity @@ -0,0 +1,155 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!29 &1 +SceneSettings: + m_ObjectHideFlags: 0 + m_PVSData: + m_PVSObjectsArray: [] + m_PVSPortalsArray: [] + m_OcclusionBakeSettings: + smallestOccluder: 5 + smallestHole: 0.25 + backfaceThreshold: 100 +--- !u!104 &2 +RenderSettings: + m_ObjectHideFlags: 0 + serializedVersion: 6 + m_Fog: 0 + m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} + m_FogMode: 3 + m_FogDensity: 0.01 + m_LinearFogStart: 0 + m_LinearFogEnd: 300 + m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} + m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} + m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} + m_AmbientIntensity: 1 + m_AmbientMode: 0 + m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0} + m_HaloStrength: 0.5 + m_FlareStrength: 1 + m_FlareFadeSpeed: 3 + m_HaloTexture: {fileID: 0} + m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} + m_DefaultReflectionMode: 0 + m_DefaultReflectionResolution: 128 + m_ReflectionBounces: 1 + m_ReflectionIntensity: 1 + m_CustomReflection: {fileID: 0} + m_Sun: {fileID: 0} +--- !u!157 &3 +LightmapSettings: + m_ObjectHideFlags: 0 + serializedVersion: 6 + m_GIWorkflowMode: 0 + m_LightmapsMode: 1 + m_GISettings: + serializedVersion: 2 + m_BounceScale: 1 + m_IndirectOutputScale: 1 + m_AlbedoBoost: 1 + m_TemporalCoherenceThreshold: 1 + m_EnvironmentLightingMode: 0 + m_EnableBakedLightmaps: 1 + m_EnableRealtimeLightmaps: 1 + m_LightmapEditorSettings: + serializedVersion: 3 + m_Resolution: 2 + m_BakeResolution: 40 + m_TextureWidth: 1024 + m_TextureHeight: 1024 + m_AOMaxDistance: 1 + m_Padding: 2 + m_CompAOExponent: 0 + m_LightmapParameters: {fileID: 0} + m_TextureCompression: 1 + m_FinalGather: 0 + m_FinalGatherRayCount: 1024 + m_ReflectionCompression: 2 + m_LightingDataAsset: {fileID: 0} + m_RuntimeCPUUsage: 25 +--- !u!196 &4 +NavMeshSettings: + serializedVersion: 2 + m_ObjectHideFlags: 0 + m_BuildSettings: + serializedVersion: 2 + agentRadius: 0.5 + agentHeight: 2 + agentSlope: 45 + agentClimb: 0.4 + ledgeDropHeight: 0 + maxJumpAcrossDistance: 0 + accuratePlacement: 0 + minRegionArea: 2 + cellSize: 0.16666667 + manualCellSize: 0 + m_NavMeshData: {fileID: 0} +--- !u!1 &978433746 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 4 + m_Component: + - 4: {fileID: 978433749} + - 114: {fileID: 978433747} + - 114: {fileID: 978433748} + m_Layer: 0 + m_Name: Runner + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &978433747 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 978433746} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 0e516af87ca41694bbaa70c373f993e0, type: 3} + m_Name: + m_EditorClassIdentifier: + _runAll: 1 + _testMethod: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 978433748} + m_MethodName: TestBasic + m_Mode: 1 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 1 + m_TypeName: UnityEngine.Events.UnityEvent, UnityEngine, Version=0.0.0.0, Culture=neutral, + PublicKeyToken=null +--- !u!114 &978433748 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 978433746} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 2deb5ef0bad19eb4985c9211357fd32f, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!4 &978433749 +Transform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 978433746} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToGameObject/TestToGameObject.unity.meta b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToGameObject/TestToGameObject.unity.meta new file mode 100644 index 000000000..dec221d53 --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToGameObject/TestToGameObject.unity.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: cd2786136f279c14db1ca265c065edb7 +timeCreated: 1458174769 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToMonoBehaviour.meta b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToMonoBehaviour.meta new file mode 100644 index 000000000..edc393cc1 --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToMonoBehaviour.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 3cd2902cb7414ed4ba89a685c8fd445f +folderAsset: yes +timeCreated: 1458256959 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToMonoBehaviour/Fixture.cs b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToMonoBehaviour/Fixture.cs new file mode 100644 index 000000000..dc2a2d7a4 --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToMonoBehaviour/Fixture.cs @@ -0,0 +1,135 @@ +using System; +using System.Collections.Generic; +using ModestTree.UnityUnitTester; +using UnityEngine; + +namespace ModestTree.Tests.Zenject.ToMonoBehaviour +{ + public class Fixture : MonoTestFixture + { + [Test] + public void TestBasic() + { + var gameObject = Container.CreateEmptyGameObject("Foo"); + + Container.BindInstance("Foo", gameObject); + + Container.Bind().FromComponent(gameObject).AsSingle(); + Container.BindRootResolve(); + + FixtureUtil.AssertComponentCount(Container, 1); + } + + [Test] + public void TestTransient() + { + var gameObject = Container.CreateEmptyGameObject("Foo"); + + Container.BindInstance("Foo", gameObject); + + Container.Bind().FromComponent(gameObject).AsTransient(); + Container.Bind().To().FromComponent(gameObject).AsTransient(); + + Container.BindRootResolve(typeof(IFoo), typeof(Foo)); + + FixtureUtil.AssertComponentCount(Container, 2); + } + + [Test] + public void TestSingle() + { + var gameObject = Container.CreateEmptyGameObject("Foo"); + + Container.BindInstance("Foo", gameObject); + + Container.Bind().FromComponent(gameObject).AsSingle(); + Container.Bind().To().FromComponent(gameObject).AsSingle(); + + Container.BindRootResolve(); + Container.BindRootResolve(); + FixtureUtil.AssertComponentCount(Container, 1); + } + + [Test] + public void TestCached1() + { + var gameObject = Container.CreateEmptyGameObject("Foo"); + + Container.BindInstance("Foo", gameObject); + + Container.Bind().FromComponent(gameObject).AsCached(); + Container.Bind().To().FromComponent(gameObject).AsCached(); + + Container.BindRootResolve(); + Container.BindRootResolve(); + FixtureUtil.AssertComponentCount(Container, 2); + } + + [Test] + public void TestCached2() + { + var gameObject = Container.CreateEmptyGameObject("Foo"); + + Container.BindInstance("Foo", gameObject); + + Container.Bind(typeof(IFoo), typeof(Foo)).To().FromComponent(gameObject).AsCached(); + + Container.BindRootResolve(); + Container.BindRootResolve(); + FixtureUtil.AssertComponentCount(Container, 1); + } + + [Test] + public void TestCachedMultipleConcrete() + { + var gameObject = Container.CreateEmptyGameObject("Foo"); + + Container.BindInstance("Foo", gameObject); + + Container.Bind(typeof(IFoo), typeof(IBar)) + .To(new List() { typeof(Foo), typeof(Bar) }).FromComponent(gameObject).AsCached(); + + Container.BindRootResolve(typeof(IFoo), typeof(IBar)); + + FixtureUtil.AssertComponentCount(Container, 1); + FixtureUtil.AssertComponentCount(Container, 1); + } + + [Test] + public void TestSingleMultipleConcrete() + { + var gameObject = Container.CreateEmptyGameObject("Foo"); + + Container.BindInstance("Foo", gameObject); + + Container.Bind(typeof(IFoo), typeof(IBar)).To(new List() { typeof(Foo), typeof(Bar) }) + .FromComponent(gameObject).AsSingle(); + Container.Bind().To().FromComponent(gameObject).AsSingle(); + + Container.BindRootResolve(typeof(IFoo), typeof(IFoo2), typeof(IBar)); + + FixtureUtil.AssertComponentCount(Container, 1); + FixtureUtil.AssertComponentCount(Container, 1); + } + + public interface IBar + { + } + + public interface IFoo2 + { + } + + public interface IFoo + { + } + + public class Foo : MonoBehaviour, IFoo, IBar, IFoo2 + { + } + + public class Bar : MonoBehaviour, IFoo, IBar, IFoo2 + { + } + } +} diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToMonoBehaviour/Fixture.cs.meta b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToMonoBehaviour/Fixture.cs.meta new file mode 100644 index 000000000..1a1654de6 --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToMonoBehaviour/Fixture.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 53dc2c7cdc3b8384faa7be16b6f424dd +timeCreated: 1458256992 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToMonoBehaviour/Foo.cs b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToMonoBehaviour/Foo.cs new file mode 100644 index 000000000..f0d0372d6 --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToMonoBehaviour/Foo.cs @@ -0,0 +1,12 @@ +using UnityEngine; + +namespace ModestTree.Tests.Zenject.ToTransientPrefab +{ + public interface IFoo + { + } + + public class Foo : MonoBehaviour, IFoo + { + } +} diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToMonoBehaviour/Foo.cs.meta b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToMonoBehaviour/Foo.cs.meta new file mode 100644 index 000000000..dc9cf29a0 --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToMonoBehaviour/Foo.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 43b55cbcde52e55429c835c47117f770 +timeCreated: 1458256992 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToMonoBehaviour/TestToMonoBehaviour.unity b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToMonoBehaviour/TestToMonoBehaviour.unity new file mode 100644 index 000000000..e35b70dac --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToMonoBehaviour/TestToMonoBehaviour.unity @@ -0,0 +1,155 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!29 &1 +SceneSettings: + m_ObjectHideFlags: 0 + m_PVSData: + m_PVSObjectsArray: [] + m_PVSPortalsArray: [] + m_OcclusionBakeSettings: + smallestOccluder: 5 + smallestHole: 0.25 + backfaceThreshold: 100 +--- !u!104 &2 +RenderSettings: + m_ObjectHideFlags: 0 + serializedVersion: 6 + m_Fog: 0 + m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} + m_FogMode: 3 + m_FogDensity: 0.01 + m_LinearFogStart: 0 + m_LinearFogEnd: 300 + m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} + m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} + m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} + m_AmbientIntensity: 1 + m_AmbientMode: 0 + m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0} + m_HaloStrength: 0.5 + m_FlareStrength: 1 + m_FlareFadeSpeed: 3 + m_HaloTexture: {fileID: 0} + m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} + m_DefaultReflectionMode: 0 + m_DefaultReflectionResolution: 128 + m_ReflectionBounces: 1 + m_ReflectionIntensity: 1 + m_CustomReflection: {fileID: 0} + m_Sun: {fileID: 0} +--- !u!157 &3 +LightmapSettings: + m_ObjectHideFlags: 0 + serializedVersion: 6 + m_GIWorkflowMode: 0 + m_LightmapsMode: 1 + m_GISettings: + serializedVersion: 2 + m_BounceScale: 1 + m_IndirectOutputScale: 1 + m_AlbedoBoost: 1 + m_TemporalCoherenceThreshold: 1 + m_EnvironmentLightingMode: 0 + m_EnableBakedLightmaps: 1 + m_EnableRealtimeLightmaps: 1 + m_LightmapEditorSettings: + serializedVersion: 3 + m_Resolution: 2 + m_BakeResolution: 40 + m_TextureWidth: 1024 + m_TextureHeight: 1024 + m_AOMaxDistance: 1 + m_Padding: 2 + m_CompAOExponent: 0 + m_LightmapParameters: {fileID: 0} + m_TextureCompression: 1 + m_FinalGather: 0 + m_FinalGatherRayCount: 1024 + m_ReflectionCompression: 2 + m_LightingDataAsset: {fileID: 0} + m_RuntimeCPUUsage: 25 +--- !u!196 &4 +NavMeshSettings: + serializedVersion: 2 + m_ObjectHideFlags: 0 + m_BuildSettings: + serializedVersion: 2 + agentRadius: 0.5 + agentHeight: 2 + agentSlope: 45 + agentClimb: 0.4 + ledgeDropHeight: 0 + maxJumpAcrossDistance: 0 + accuratePlacement: 0 + minRegionArea: 2 + cellSize: 0.16666667 + manualCellSize: 0 + m_NavMeshData: {fileID: 0} +--- !u!1 &978433746 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 4 + m_Component: + - 4: {fileID: 978433749} + - 114: {fileID: 978433747} + - 114: {fileID: 978433750} + m_Layer: 0 + m_Name: SceneCompositionRoot + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &978433747 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 978433746} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 0e516af87ca41694bbaa70c373f993e0, type: 3} + m_Name: + m_EditorClassIdentifier: + _runAll: 1 + _testMethod: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 978433750} + m_MethodName: 546573744361636865644d756c7469706c65436f6e6372657465 + m_Mode: 1 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: 556e697479456e67696e652e4f626a6563742c20556e697479456e67696e65 + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 1 + m_TypeName: UnityEngine.Events.UnityEvent, UnityEngine, Version=0.0.0.0, Culture=neutral, + PublicKeyToken=null +--- !u!4 &978433749 +Transform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 978433746} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 +--- !u!114 &978433750 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 978433746} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 53dc2c7cdc3b8384faa7be16b6f424dd, type: 3} + m_Name: + m_EditorClassIdentifier: diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToMonoBehaviour/TestToMonoBehaviour.unity.meta b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToMonoBehaviour/TestToMonoBehaviour.unity.meta new file mode 100644 index 000000000..e59b241aa --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToMonoBehaviour/TestToMonoBehaviour.unity.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 07b92e39b79a9684da04dfdc3511340d +timeCreated: 1458256992 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefab.meta b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefab.meta new file mode 100644 index 000000000..14dc95723 --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefab.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 26b8c3a53935b834ba5f7eb4c08d0568 +folderAsset: yes +timeCreated: 1458174645 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefab/Bar.cs b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefab/Bar.cs new file mode 100644 index 000000000..12382c8b4 --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefab/Bar.cs @@ -0,0 +1,8 @@ +using UnityEngine; + +namespace ModestTree.Tests.Zenject.ToPrefab +{ + public class Bar : MonoBehaviour + { + } +} diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefab/Bar.cs.meta b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefab/Bar.cs.meta new file mode 100644 index 000000000..4017215d5 --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefab/Bar.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 86870631eb8b52e409ad0b86fd44aad7 +timeCreated: 1458314694 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefab/Bob.cs b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefab/Bob.cs new file mode 100644 index 000000000..df205eeba --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefab/Bob.cs @@ -0,0 +1,13 @@ +using System; +using UnityEngine; +using Zenject; + +namespace ModestTree.Tests.Zenject.ToPrefab +{ + public class Bob : MonoBehaviour + { + [NonSerialized] + [Inject] + public Jim Jim; + } +} diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefab/Bob.cs.meta b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefab/Bob.cs.meta new file mode 100644 index 000000000..fb8b415f8 --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefab/Bob.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: aeb709c66d821b242b8e5016c31bb2d2 +timeCreated: 1459009627 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefab/Fixture.cs b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefab/Fixture.cs new file mode 100644 index 000000000..131d39214 --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefab/Fixture.cs @@ -0,0 +1,165 @@ +using System.Collections.Generic; +using ModestTree.UnityUnitTester; +using UnityEngine; +using Zenject; + +namespace ModestTree.Tests.Zenject.ToPrefab +{ + public class Fixture : MonoTestFixture + { + public GameObject FooPrefab; + public GameObject FooPrefab2; + public GameObject GorpAndQuxPrefab; + public GameObject NorfPrefab; + public GameObject JimAndBobPrefab; + + [Test] + public void TestTransient() + { + Container.Bind().FromPrefab(FooPrefab).AsTransient(); + Container.Bind().FromPrefab(FooPrefab).AsTransient(); + + Container.BindRootResolve(); + + FixtureUtil.AssertComponentCount(Container, 2); + } + + [Test] + public void TestSingle() + { + Container.Bind().To().FromPrefab(FooPrefab).AsSingle(); + Container.Bind().FromPrefab(FooPrefab).AsSingle(); + + Container.BindRootResolve(); + Container.BindRootResolve(); + + FixtureUtil.AssertComponentCount(Container, 1); + } + + [Test] + public void TestSingle2() + { + // For ToPrefab, the 'AsSingle' applies to the prefab and not the type, so this is valid + Container.Bind().To().FromPrefab(FooPrefab).AsSingle(); + Container.Bind().FromPrefab(FooPrefab2).AsSingle(); + Container.Bind().FromMethod(ctx => ctx.Container.CreateEmptyGameObject("Foo").AddComponent()); + + Container.BindRootResolve(); + Container.BindRootResolve(); + + FixtureUtil.AssertComponentCount(Container, 3); + FixtureUtil.AssertNumGameObjects(Container, 3); + } + + [Test] + public void TestSingleIdentifiers() + { + Container.Bind().FromPrefab(FooPrefab).WithGameObjectName("Foo").AsSingle(); + Container.Bind().FromPrefab(FooPrefab).WithGameObjectName("Foo").AsSingle(); + + Container.BindRootResolve(); + Container.BindRootResolve(); + + FixtureUtil.AssertNumGameObjects(Container, 1); + FixtureUtil.AssertComponentCount(Container, 1); + FixtureUtil.AssertComponentCount(Container, 1); + FixtureUtil.AssertNumGameObjectsWithName(Container, "Foo", 1); + } + + [Test] + public void TestCached1() + { + Container.Bind(typeof(Foo), typeof(Bar)).FromPrefab(FooPrefab).WithGameObjectName("Foo").AsCached(); + + Container.BindRootResolve(); + Container.BindRootResolve(); + + FixtureUtil.AssertNumGameObjects(Container, 1); + FixtureUtil.AssertComponentCount(Container, 1); + FixtureUtil.AssertComponentCount(Container, 1); + FixtureUtil.AssertNumGameObjectsWithName(Container, "Foo", 1); + } + + [Test] + [ExpectedException] + [ExpectedValidationException] + public void TestWithArgumentsFail() + { + // They have required arguments + Container.Bind(typeof(Gorp), typeof(Qux)).FromPrefab(GorpAndQuxPrefab).AsCached(); + + Container.BindRootResolve(); + Container.BindRootResolve(); + } + + [Test] + public void TestWithArguments() + { + Container.Bind(typeof(Gorp), typeof(Qux)) + .FromPrefab(GorpAndQuxPrefab).WithGameObjectName("GorpAndQux").AsCached() + .WithArguments(5, "test1"); + + Container.BindRootResolve(); + Container.BindRootResolve(); + + FixtureUtil.AssertNumGameObjects(Container, 1); + FixtureUtil.AssertComponentCount(Container, 1); + FixtureUtil.AssertComponentCount(Container, 1); + FixtureUtil.AssertNumGameObjectsWithName(Container, "GorpAndQux", 1); + } + + [Test] + public void TestWithAbstractSearch() + { + // There are three components that implement INorf on this prefab + // and so this should result in a list of 3 INorf's + Container.Bind().FromPrefab(NorfPrefab); + + FixtureUtil.AssertNumGameObjects(Container, 1); + FixtureUtil.AssertComponentCount(Container, 3); + FixtureUtil.AssertResolveCount(Container, 3); + } + + [Test] + public void TestAbstractBindingConcreteSearch() + { + // Should ignore the Norf2 component on it + Container.Bind().To().FromPrefab(NorfPrefab); + + FixtureUtil.AssertNumGameObjects(Container, 1); + FixtureUtil.AssertResolveCount(Container, 2); + } + + [Test] + public void TestCircularDependencies() + { + // Jim and Bob both depend on each other + Container.Bind(typeof(Jim), typeof(Bob)).FromPrefab(JimAndBobPrefab).AsCached(); + + Container.BindRootResolve(); + Container.BindRootResolve(); + + Container.BindAllInterfaces().To().AsSingle(); + } + + public class JimAndBobRunner : IInitializable + { + readonly Bob _bob; + readonly Jim _jim; + + public JimAndBobRunner(Jim jim, Bob bob) + { + _bob = bob; + _jim = jim; + } + + public void Initialize() + { + Assert.IsNotNull(_jim.Bob); + Assert.IsNotNull(_bob.Jim); + + Log.Info("Jim and bob successfully got the other reference"); + } + } + } +} diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefab/Fixture.cs.meta b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefab/Fixture.cs.meta new file mode 100644 index 000000000..9a9366c94 --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefab/Fixture.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 9a11ff4a9421f2949993c4dc34f50335 +timeCreated: 1454819941 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefab/Foo.cs b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefab/Foo.cs new file mode 100644 index 000000000..4da18171b --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefab/Foo.cs @@ -0,0 +1,12 @@ +using UnityEngine; + +namespace ModestTree.Tests.Zenject.ToPrefab +{ + public interface IFoo + { + } + + public class Foo : MonoBehaviour, IFoo + { + } +} diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefab/Foo.cs.meta b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefab/Foo.cs.meta new file mode 100644 index 000000000..9bec9821e --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefab/Foo.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: f39c997bb2d185144bc18d37878d4ab8 +timeCreated: 1458245958 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefab/Foo.prefab b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefab/Foo.prefab new file mode 100644 index 000000000..b2df270b5 --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefab/Foo.prefab @@ -0,0 +1,64 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &154292 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 4: {fileID: 496146} + - 114: {fileID: 11420556} + - 114: {fileID: 11472394} + m_Layer: 0 + m_Name: Foo + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &496146 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 154292} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 +--- !u!114 &11420556 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 154292} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f39c997bb2d185144bc18d37878d4ab8, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!114 &11472394 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 154292} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 86870631eb8b52e409ad0b86fd44aad7, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!1001 &100100000 +Prefab: + m_ObjectHideFlags: 1 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: [] + m_RemovedComponents: [] + m_ParentPrefab: {fileID: 0} + m_RootGameObject: {fileID: 154292} + m_IsPrefabParent: 1 diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefab/Foo.prefab.meta b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefab/Foo.prefab.meta new file mode 100644 index 000000000..a10590a8d --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefab/Foo.prefab.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 7d3811faab260ce4dab063fd012b42b5 +timeCreated: 1454692704 +licenseType: Pro +NativeFormatImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefab/Foo2.prefab b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefab/Foo2.prefab new file mode 100644 index 000000000..8bdb54d44 --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefab/Foo2.prefab @@ -0,0 +1,52 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &154292 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 4: {fileID: 496146} + - 114: {fileID: 11420556} + m_Layer: 0 + m_Name: Foo2 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &496146 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 154292} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 +--- !u!114 &11420556 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 154292} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f39c997bb2d185144bc18d37878d4ab8, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!1001 &100100000 +Prefab: + m_ObjectHideFlags: 1 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: [] + m_RemovedComponents: [] + m_ParentPrefab: {fileID: 0} + m_RootGameObject: {fileID: 154292} + m_IsPrefabParent: 1 diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefab/Foo2.prefab.meta b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefab/Foo2.prefab.meta new file mode 100644 index 000000000..c22a2e760 --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefab/Foo2.prefab.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: d0fc7ecead470be4d8ac1114be3d9d62 +timeCreated: 1458261082 +licenseType: Free +NativeFormatImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefab/Gorp.cs b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefab/Gorp.cs new file mode 100644 index 000000000..8a37f8026 --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefab/Gorp.cs @@ -0,0 +1,17 @@ +using UnityEngine; +using Zenject; + +namespace ModestTree.Tests.Zenject.ToPrefab +{ + public class Gorp : MonoBehaviour + { + [Inject] + string _arg; + + [PostInject] + public void Initialize() + { + Log.Trace("Received arg '{0}' in Gorp", _arg); + } + } +} diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefab/Gorp.cs.meta b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefab/Gorp.cs.meta new file mode 100644 index 000000000..b2876cf0c --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefab/Gorp.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: cc679fbba1bf0a645957d68235c4771d +timeCreated: 1459002694 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefab/Jim.cs b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefab/Jim.cs new file mode 100644 index 000000000..92ab43e75 --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefab/Jim.cs @@ -0,0 +1,13 @@ +using System; +using UnityEngine; +using Zenject; + +namespace ModestTree.Tests.Zenject.ToPrefab +{ + public class Jim : MonoBehaviour + { + [NonSerialized] + [Inject] + public Bob Bob; + } +} diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefab/Jim.cs.meta b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefab/Jim.cs.meta new file mode 100644 index 000000000..4fe62bd3e --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefab/Jim.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 78b17c518e97edb498c1ff8a4d914bd5 +timeCreated: 1459009626 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefab/JimAndBob.prefab b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefab/JimAndBob.prefab new file mode 100644 index 000000000..cf7a49517 --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefab/JimAndBob.prefab @@ -0,0 +1,64 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &124956 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 4: {fileID: 464534} + - 114: {fileID: 11499784} + - 114: {fileID: 11418142} + m_Layer: 0 + m_Name: JimAndBob + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &464534 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 124956} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 +--- !u!114 &11418142 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 124956} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: aeb709c66d821b242b8e5016c31bb2d2, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!114 &11499784 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 124956} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 78b17c518e97edb498c1ff8a4d914bd5, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!1001 &100100000 +Prefab: + m_ObjectHideFlags: 1 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: [] + m_RemovedComponents: [] + m_ParentPrefab: {fileID: 0} + m_RootGameObject: {fileID: 124956} + m_IsPrefabParent: 1 diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefab/JimAndBob.prefab.meta b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefab/JimAndBob.prefab.meta new file mode 100644 index 000000000..481d93ca5 --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefab/JimAndBob.prefab.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 1592e529a326aad4b8a0a8c4640f000e +timeCreated: 1459009683 +licenseType: Pro +NativeFormatImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefab/Norf.cs b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefab/Norf.cs new file mode 100644 index 000000000..64f0f0d7b --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefab/Norf.cs @@ -0,0 +1,13 @@ +using System; +using UnityEngine; + +namespace ModestTree.Tests.Zenject.ToPrefab +{ + public interface INorf + { + } + + public class Norf : MonoBehaviour, INorf + { + } +} diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefab/Norf.cs.meta b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefab/Norf.cs.meta new file mode 100644 index 000000000..ca29f2890 --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefab/Norf.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 91f7cce5532e4cc4796d58d33d783a80 +timeCreated: 1459008624 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefab/Norf.prefab b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefab/Norf.prefab new file mode 100644 index 000000000..af86ce80c --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefab/Norf.prefab @@ -0,0 +1,76 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &199570 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 4: {fileID: 431222} + - 114: {fileID: 11449184} + - 114: {fileID: 11420968} + - 114: {fileID: 11461460} + m_Layer: 0 + m_Name: Norf + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &431222 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 199570} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 +--- !u!114 &11420968 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 199570} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 91f7cce5532e4cc4796d58d33d783a80, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!114 &11449184 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 199570} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 91f7cce5532e4cc4796d58d33d783a80, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!114 &11461460 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 199570} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 8fb03bf3db5129643a756826728ce939, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!1001 &100100000 +Prefab: + m_ObjectHideFlags: 1 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: [] + m_RemovedComponents: [] + m_ParentPrefab: {fileID: 0} + m_RootGameObject: {fileID: 199570} + m_IsPrefabParent: 1 diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefab/Norf.prefab.meta b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefab/Norf.prefab.meta new file mode 100644 index 000000000..84a94f909 --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefab/Norf.prefab.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 3f9121b460e6fb541a5dfd7384d5c03a +timeCreated: 1459008724 +licenseType: Pro +NativeFormatImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefab/Norf2.cs b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefab/Norf2.cs new file mode 100644 index 000000000..37dae6217 --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefab/Norf2.cs @@ -0,0 +1,10 @@ +using System; +using UnityEngine; + +namespace ModestTree.Tests.Zenject.ToPrefab +{ + public class Norf2 : MonoBehaviour, INorf + { + } +} + diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefab/Norf2.cs.meta b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefab/Norf2.cs.meta new file mode 100644 index 000000000..c9ba6a310 --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefab/Norf2.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 8fb03bf3db5129643a756826728ce939 +timeCreated: 1459008655 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefab/Qux.cs b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefab/Qux.cs new file mode 100644 index 000000000..bb263f716 --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefab/Qux.cs @@ -0,0 +1,17 @@ +using UnityEngine; +using Zenject; + +namespace ModestTree.Tests.Zenject.ToPrefab +{ + public class Qux : MonoBehaviour + { + [Inject] + int _arg; + + [PostInject] + public void Initialize() + { + Log.Trace("Received arg '{0}' in Qux", _arg); + } + } +} diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefab/Qux.cs.meta b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefab/Qux.cs.meta new file mode 100644 index 000000000..ea9ec0539 --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefab/Qux.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 914f813dee2b8b248bce3b21eafa7b6e +timeCreated: 1459002695 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefab/QuxAndGorp.prefab b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefab/QuxAndGorp.prefab new file mode 100644 index 000000000..1928af527 --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefab/QuxAndGorp.prefab @@ -0,0 +1,64 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &154292 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 4: {fileID: 496146} + - 114: {fileID: 11461012} + - 114: {fileID: 11470700} + m_Layer: 0 + m_Name: QuxAndGorp + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &496146 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 154292} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 +--- !u!114 &11461012 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 154292} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 914f813dee2b8b248bce3b21eafa7b6e, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!114 &11470700 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 154292} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: cc679fbba1bf0a645957d68235c4771d, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!1001 &100100000 +Prefab: + m_ObjectHideFlags: 1 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: [] + m_RemovedComponents: [] + m_ParentPrefab: {fileID: 0} + m_RootGameObject: {fileID: 154292} + m_IsPrefabParent: 1 diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefab/QuxAndGorp.prefab.meta b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefab/QuxAndGorp.prefab.meta new file mode 100644 index 000000000..73ce7c0b8 --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefab/QuxAndGorp.prefab.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: a9f9ff1c71e66294f910610d2194c731 +timeCreated: 1459002680 +licenseType: Pro +NativeFormatImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefab/TestToPrefab.unity b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefab/TestToPrefab.unity new file mode 100644 index 000000000..f43454314 --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefab/TestToPrefab.unity @@ -0,0 +1,160 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!29 &1 +SceneSettings: + m_ObjectHideFlags: 0 + m_PVSData: + m_PVSObjectsArray: [] + m_PVSPortalsArray: [] + m_OcclusionBakeSettings: + smallestOccluder: 5 + smallestHole: 0.25 + backfaceThreshold: 100 +--- !u!104 &2 +RenderSettings: + m_ObjectHideFlags: 0 + serializedVersion: 6 + m_Fog: 0 + m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} + m_FogMode: 3 + m_FogDensity: 0.01 + m_LinearFogStart: 0 + m_LinearFogEnd: 300 + m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} + m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} + m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} + m_AmbientIntensity: 1 + m_AmbientMode: 0 + m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0} + m_HaloStrength: 0.5 + m_FlareStrength: 1 + m_FlareFadeSpeed: 3 + m_HaloTexture: {fileID: 0} + m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} + m_DefaultReflectionMode: 0 + m_DefaultReflectionResolution: 128 + m_ReflectionBounces: 1 + m_ReflectionIntensity: 1 + m_CustomReflection: {fileID: 0} + m_Sun: {fileID: 0} +--- !u!157 &3 +LightmapSettings: + m_ObjectHideFlags: 0 + serializedVersion: 6 + m_GIWorkflowMode: 0 + m_LightmapsMode: 1 + m_GISettings: + serializedVersion: 2 + m_BounceScale: 1 + m_IndirectOutputScale: 1 + m_AlbedoBoost: 1 + m_TemporalCoherenceThreshold: 1 + m_EnvironmentLightingMode: 0 + m_EnableBakedLightmaps: 1 + m_EnableRealtimeLightmaps: 1 + m_LightmapEditorSettings: + serializedVersion: 3 + m_Resolution: 2 + m_BakeResolution: 40 + m_TextureWidth: 1024 + m_TextureHeight: 1024 + m_AOMaxDistance: 1 + m_Padding: 2 + m_CompAOExponent: 0 + m_LightmapParameters: {fileID: 0} + m_TextureCompression: 1 + m_FinalGather: 0 + m_FinalGatherRayCount: 1024 + m_ReflectionCompression: 2 + m_LightingDataAsset: {fileID: 0} + m_RuntimeCPUUsage: 25 +--- !u!196 &4 +NavMeshSettings: + serializedVersion: 2 + m_ObjectHideFlags: 0 + m_BuildSettings: + serializedVersion: 2 + agentRadius: 0.5 + agentHeight: 2 + agentSlope: 45 + agentClimb: 0.4 + ledgeDropHeight: 0 + maxJumpAcrossDistance: 0 + accuratePlacement: 0 + minRegionArea: 2 + cellSize: 0.16666667 + manualCellSize: 0 + m_NavMeshData: {fileID: 0} +--- !u!1 &42935781 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 4 + m_Component: + - 4: {fileID: 42935785} + - 114: {fileID: 42935783} + - 114: {fileID: 42935782} + m_Layer: 0 + m_Name: SceneCompositionRoot + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &42935782 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 42935781} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 9a11ff4a9421f2949993c4dc34f50335, type: 3} + m_Name: + m_EditorClassIdentifier: + FooPrefab: {fileID: 154292, guid: 7d3811faab260ce4dab063fd012b42b5, type: 2} + FooPrefab2: {fileID: 154292, guid: d0fc7ecead470be4d8ac1114be3d9d62, type: 2} + GorpAndQuxPrefab: {fileID: 154292, guid: a9f9ff1c71e66294f910610d2194c731, type: 2} + NorfPrefab: {fileID: 199570, guid: 3f9121b460e6fb541a5dfd7384d5c03a, type: 2} + JimAndBobPrefab: {fileID: 124956, guid: 1592e529a326aad4b8a0a8c4640f000e, type: 2} +--- !u!114 &42935783 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 42935781} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 0e516af87ca41694bbaa70c373f993e0, type: 3} + m_Name: + m_EditorClassIdentifier: + _runAll: 1 + _testMethod: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 42935782} + m_MethodName: TestWithArgumentsFail + m_Mode: 1 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 1 + m_TypeName: UnityEngine.Events.UnityEvent, UnityEngine, Version=0.0.0.0, Culture=neutral, + PublicKeyToken=null +--- !u!4 &42935785 +Transform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 42935781} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefab/TestToPrefab.unity.meta b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefab/TestToPrefab.unity.meta new file mode 100644 index 000000000..b03e4ce68 --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefab/TestToPrefab.unity.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 6982f48aa0200514ca8251ba55b239b0 +timeCreated: 1458226369 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefabResource.meta b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefabResource.meta new file mode 100644 index 000000000..2a6bc4c71 --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefabResource.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 82e107c22aad72445b07c23306db54c7 +folderAsset: yes +timeCreated: 1458255572 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefabResource/Bar.cs b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefabResource/Bar.cs new file mode 100644 index 000000000..beb8697ec --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefabResource/Bar.cs @@ -0,0 +1,8 @@ +using UnityEngine; + +namespace ModestTree.Tests.Zenject.ToPrefabResource +{ + public class Bar : MonoBehaviour + { + } +} diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefabResource/Bar.cs.meta b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefabResource/Bar.cs.meta new file mode 100644 index 000000000..21f2aebb0 --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefabResource/Bar.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 09cb1c767472bd447ab51093e4a17ad3 +timeCreated: 1459015737 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefabResource/Bob.cs b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefabResource/Bob.cs new file mode 100644 index 000000000..7fc1aee01 --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefabResource/Bob.cs @@ -0,0 +1,13 @@ +using System; +using UnityEngine; +using Zenject; + +namespace ModestTree.Tests.Zenject.ToPrefabResource +{ + public class Bob : MonoBehaviour + { + [NonSerialized] + [Inject] + public Jim Jim; + } +} diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefabResource/Bob.cs.meta b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefabResource/Bob.cs.meta new file mode 100644 index 000000000..915a87648 --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefabResource/Bob.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 93bfc10f4bb073945911d600dea398a5 +timeCreated: 1459015737 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefabResource/Fixture.cs b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefabResource/Fixture.cs new file mode 100644 index 000000000..a42f3ccb0 --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefabResource/Fixture.cs @@ -0,0 +1,172 @@ +using System.Collections.Generic; +using ModestTree.UnityUnitTester; +using UnityEngine; +using Zenject; + +namespace ModestTree.Tests.Zenject.ToPrefabResource +{ + public class Fixture : MonoTestFixture + { + const string PathPrefix = "TestToPrefabResource/"; + + [Test] + [ExpectedException] + [ExpectedValidationException] + public void TestTransientError() + { + // Validation should detect that it doesn't exist + Container.Bind().FromPrefabResource(PathPrefix + "asdfasdfas").AsTransient(); + + Container.BindRootResolve(); + } + + [Test] + public void TestTransient() + { + Container.Bind().FromPrefabResource(PathPrefix + "Foo").AsTransient(); + Container.Bind().FromPrefabResource(PathPrefix + "Foo").AsTransient(); + + Container.BindRootResolve(); + + FixtureUtil.AssertComponentCount(Container, 2); + } + + [Test] + public void TestSingle() + { + Container.Bind().To().FromPrefabResource(PathPrefix + "Foo").AsSingle(); + Container.Bind().FromPrefabResource(PathPrefix + "Foo").AsSingle(); + + Container.BindRootResolve(); + Container.BindRootResolve(); + + FixtureUtil.AssertComponentCount(Container, 1); + } + + [Test] + public void TestSingle2() + { + // For ToPrefab, the 'AsSingle' applies to the prefab and not the type, so this is valid + Container.Bind().To().FromPrefabResource(PathPrefix + "Foo").AsSingle(); + Container.Bind().FromPrefabResource(PathPrefix + "Foo2").AsSingle(); + Container.Bind().FromMethod(ctx => ctx.Container.CreateEmptyGameObject("Foo").AddComponent()); + + Container.BindRootResolve(); + Container.BindRootResolve(); + + FixtureUtil.AssertComponentCount(Container, 3); + FixtureUtil.AssertNumGameObjects(Container, 3); + } + + [Test] + public void TestSingleIdentifiers() + { + Container.Bind().FromPrefabResource(PathPrefix + "Foo").WithGameObjectName("Foo").AsSingle(); + Container.Bind().FromPrefabResource(PathPrefix + "Foo").WithGameObjectName("Foo").AsSingle(); + + Container.BindRootResolve(); + Container.BindRootResolve(); + + FixtureUtil.AssertNumGameObjects(Container, 1); + FixtureUtil.AssertComponentCount(Container, 1); + FixtureUtil.AssertComponentCount(Container, 1); + FixtureUtil.AssertNumGameObjectsWithName(Container, "Foo", 1); + } + + [Test] + public void TestCached1() + { + Container.Bind(typeof(Foo), typeof(Bar)).FromPrefabResource(PathPrefix + "Foo").WithGameObjectName("Foo").AsCached(); + + Container.BindRootResolve(); + Container.BindRootResolve(); + + FixtureUtil.AssertNumGameObjects(Container, 1); + FixtureUtil.AssertComponentCount(Container, 1); + FixtureUtil.AssertComponentCount(Container, 1); + FixtureUtil.AssertNumGameObjectsWithName(Container, "Foo", 1); + } + + [Test] + [ExpectedException] + [ExpectedValidationException] + public void TestWithArgumentsFail() + { + // They have required arguments + Container.Bind(typeof(Gorp), typeof(Qux)).FromPrefabResource(PathPrefix + "GorpAndQux").AsCached(); + + Container.BindRootResolve(); + Container.BindRootResolve(); + } + + [Test] + public void TestWithArguments() + { + Container.Bind(typeof(Gorp), typeof(Qux)) + .FromPrefabResource(PathPrefix + "GorpAndQux").WithGameObjectName("GorpAndQux").AsCached() + .WithArguments(5, "test1"); + + Container.BindRootResolve(); + Container.BindRootResolve(); + + FixtureUtil.AssertNumGameObjects(Container, 1); + FixtureUtil.AssertComponentCount(Container, 1); + FixtureUtil.AssertComponentCount(Container, 1); + FixtureUtil.AssertNumGameObjectsWithName(Container, "GorpAndQux", 1); + } + + [Test] + public void TestWithAbstractSearch() + { + // There are three components that implement INorf on this prefab + // and so this should result in a list of 3 INorf's + Container.Bind().FromPrefabResource(PathPrefix + "Norf"); + + FixtureUtil.AssertNumGameObjects(Container, 1); + FixtureUtil.AssertComponentCount(Container, 3); + FixtureUtil.AssertResolveCount(Container, 3); + } + + [Test] + public void TestAbstractBindingConcreteSearch() + { + // Should ignore the Norf2 component on it + Container.Bind().To().FromPrefabResource(PathPrefix + "Norf"); + + FixtureUtil.AssertNumGameObjects(Container, 1); + FixtureUtil.AssertResolveCount(Container, 2); + } + + [Test] + public void TestCircularDependencies() + { + // Jim and Bob both depend on each other + Container.Bind(typeof(Jim), typeof(Bob)).FromPrefabResource(PathPrefix + "JimAndBob").AsCached(); + + Container.BindRootResolve(); + Container.BindRootResolve(); + + Container.BindAllInterfaces().To().AsSingle(); + } + + public class JimAndBobRunner : IInitializable + { + readonly Bob _bob; + readonly Jim _jim; + + public JimAndBobRunner(Jim jim, Bob bob) + { + _bob = bob; + _jim = jim; + } + + public void Initialize() + { + Assert.IsNotNull(_jim.Bob); + Assert.IsNotNull(_bob.Jim); + + Log.Info("Jim and bob successfully got the other reference"); + } + } + } +} diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefabResource/Fixture.cs.meta b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefabResource/Fixture.cs.meta new file mode 100644 index 000000000..be3e3d5f8 --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefabResource/Fixture.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 4306a5fdd341f47499a87de2cb158a46 +timeCreated: 1458255591 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefabResource/Foo.cs b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefabResource/Foo.cs new file mode 100644 index 000000000..caeabebc7 --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefabResource/Foo.cs @@ -0,0 +1,12 @@ +using UnityEngine; + +namespace ModestTree.Tests.Zenject.ToPrefabResource +{ + public interface IFoo + { + } + + public class Foo : MonoBehaviour, IFoo + { + } +} diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefabResource/Foo.cs.meta b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefabResource/Foo.cs.meta new file mode 100644 index 000000000..e43ec2b53 --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefabResource/Foo.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: c4fe41d55bac23c408a020415051f590 +timeCreated: 1459015737 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefabResource/Gorp.cs b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefabResource/Gorp.cs new file mode 100644 index 000000000..75e6bf180 --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefabResource/Gorp.cs @@ -0,0 +1,17 @@ +using UnityEngine; +using Zenject; + +namespace ModestTree.Tests.Zenject.ToPrefabResource +{ + public class Gorp : MonoBehaviour + { + [Inject] + string _arg; + + [PostInject] + public void Initialize() + { + Log.Trace("Received arg '{0}' in Gorp", _arg); + } + } +} diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefabResource/Gorp.cs.meta b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefabResource/Gorp.cs.meta new file mode 100644 index 000000000..9874b539e --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefabResource/Gorp.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 93bd1149166ed44478c2e59b34fbfc9b +timeCreated: 1459015737 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefabResource/Jim.cs b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefabResource/Jim.cs new file mode 100644 index 000000000..0cd705544 --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefabResource/Jim.cs @@ -0,0 +1,13 @@ +using System; +using UnityEngine; +using Zenject; + +namespace ModestTree.Tests.Zenject.ToPrefabResource +{ + public class Jim : MonoBehaviour + { + [NonSerialized] + [Inject] + public Bob Bob; + } +} diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefabResource/Jim.cs.meta b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefabResource/Jim.cs.meta new file mode 100644 index 000000000..2ca71b84c --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefabResource/Jim.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 6dd802b9b69c51443af5311b06b79ca0 +timeCreated: 1459015737 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefabResource/Norf.cs b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefabResource/Norf.cs new file mode 100644 index 000000000..3a544507a --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefabResource/Norf.cs @@ -0,0 +1,13 @@ +using System; +using UnityEngine; + +namespace ModestTree.Tests.Zenject.ToPrefabResource +{ + public interface INorf + { + } + + public class Norf : MonoBehaviour, INorf + { + } +} diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefabResource/Norf.cs.meta b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefabResource/Norf.cs.meta new file mode 100644 index 000000000..defc63a37 --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefabResource/Norf.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 434e869aa9c49e046b97da50b0dfa819 +timeCreated: 1459015737 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefabResource/Norf2.cs b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefabResource/Norf2.cs new file mode 100644 index 000000000..66071fd61 --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefabResource/Norf2.cs @@ -0,0 +1,10 @@ +using System; +using UnityEngine; + +namespace ModestTree.Tests.Zenject.ToPrefabResource +{ + public class Norf2 : MonoBehaviour, INorf + { + } +} + diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefabResource/Norf2.cs.meta b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefabResource/Norf2.cs.meta new file mode 100644 index 000000000..20d270be4 --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefabResource/Norf2.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: cf6600df40401e046af9c2ebfbf58b46 +timeCreated: 1459015737 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefabResource/Qux.cs b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefabResource/Qux.cs new file mode 100644 index 000000000..1114f4ad9 --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefabResource/Qux.cs @@ -0,0 +1,17 @@ +using UnityEngine; +using Zenject; + +namespace ModestTree.Tests.Zenject.ToPrefabResource +{ + public class Qux : MonoBehaviour + { + [Inject] + int _arg; + + [PostInject] + public void Initialize() + { + Log.Trace("Received arg '{0}' in Qux", _arg); + } + } +} diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefabResource/Qux.cs.meta b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefabResource/Qux.cs.meta new file mode 100644 index 000000000..60c540b9d --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefabResource/Qux.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: b244b0173d6179840b86ed145aaa6bb2 +timeCreated: 1459015737 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefabResource/Resources.meta b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefabResource/Resources.meta new file mode 100644 index 000000000..84bb69a6b --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefabResource/Resources.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: b4cf3e3fda8e2cf48ae3c2cbada441dd +folderAsset: yes +timeCreated: 1459015750 +licenseType: Pro +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefabResource/Resources/TestToPrefabResource.meta b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefabResource/Resources/TestToPrefabResource.meta new file mode 100644 index 000000000..db3b9f894 --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefabResource/Resources/TestToPrefabResource.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 1fb22ad99723e0d4ea93fcd5fc7b4f81 +folderAsset: yes +timeCreated: 1459015756 +licenseType: Pro +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefabResource/Resources/TestToPrefabResource/Foo.prefab b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefabResource/Resources/TestToPrefabResource/Foo.prefab new file mode 100644 index 000000000..e8788a4b1 --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefabResource/Resources/TestToPrefabResource/Foo.prefab @@ -0,0 +1,64 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &154292 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 4: {fileID: 496146} + - 114: {fileID: 11408316} + - 114: {fileID: 11424772} + m_Layer: 0 + m_Name: Foo + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &496146 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 154292} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 +--- !u!114 &11408316 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 154292} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 09cb1c767472bd447ab51093e4a17ad3, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!114 &11424772 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 154292} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: c4fe41d55bac23c408a020415051f590, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!1001 &100100000 +Prefab: + m_ObjectHideFlags: 1 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: [] + m_RemovedComponents: [] + m_ParentPrefab: {fileID: 0} + m_RootGameObject: {fileID: 154292} + m_IsPrefabParent: 1 diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefabResource/Resources/TestToPrefabResource/Foo.prefab.meta b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefabResource/Resources/TestToPrefabResource/Foo.prefab.meta new file mode 100644 index 000000000..320d90df2 --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefabResource/Resources/TestToPrefabResource/Foo.prefab.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: f35ac9a6aa0dab64bafb5461a8fd393a +timeCreated: 1459015737 +licenseType: Pro +NativeFormatImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefabResource/Resources/TestToPrefabResource/Foo2.prefab b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefabResource/Resources/TestToPrefabResource/Foo2.prefab new file mode 100644 index 000000000..50fa4ba76 --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefabResource/Resources/TestToPrefabResource/Foo2.prefab @@ -0,0 +1,52 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &154292 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 4: {fileID: 496146} + - 114: {fileID: 11415242} + m_Layer: 0 + m_Name: Foo2 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &496146 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 154292} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 +--- !u!114 &11415242 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 154292} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: c4fe41d55bac23c408a020415051f590, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!1001 &100100000 +Prefab: + m_ObjectHideFlags: 1 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: [] + m_RemovedComponents: [] + m_ParentPrefab: {fileID: 0} + m_RootGameObject: {fileID: 154292} + m_IsPrefabParent: 1 diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefabResource/Resources/TestToPrefabResource/Foo2.prefab.meta b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefabResource/Resources/TestToPrefabResource/Foo2.prefab.meta new file mode 100644 index 000000000..087fe93e0 --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefabResource/Resources/TestToPrefabResource/Foo2.prefab.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 54bc08272e3f439458c8c656d27da5bc +timeCreated: 1459015737 +licenseType: Pro +NativeFormatImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefabResource/Resources/TestToPrefabResource/GorpAndQux.prefab b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefabResource/Resources/TestToPrefabResource/GorpAndQux.prefab new file mode 100644 index 000000000..2edc6f5c9 --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefabResource/Resources/TestToPrefabResource/GorpAndQux.prefab @@ -0,0 +1,64 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &154292 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 4: {fileID: 496146} + - 114: {fileID: 11498922} + - 114: {fileID: 11419060} + m_Layer: 0 + m_Name: GorpAndQux + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &496146 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 154292} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 +--- !u!114 &11419060 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 154292} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 93bd1149166ed44478c2e59b34fbfc9b, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!114 &11498922 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 154292} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: b244b0173d6179840b86ed145aaa6bb2, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!1001 &100100000 +Prefab: + m_ObjectHideFlags: 1 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: [] + m_RemovedComponents: [] + m_ParentPrefab: {fileID: 0} + m_RootGameObject: {fileID: 154292} + m_IsPrefabParent: 1 diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefabResource/Resources/TestToPrefabResource/GorpAndQux.prefab.meta b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefabResource/Resources/TestToPrefabResource/GorpAndQux.prefab.meta new file mode 100644 index 000000000..8800bfe7b --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefabResource/Resources/TestToPrefabResource/GorpAndQux.prefab.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: bfe2502efa3e0b3438c53be39dad6c3c +timeCreated: 1459015737 +licenseType: Pro +NativeFormatImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefabResource/Resources/TestToPrefabResource/JimAndBob.prefab b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefabResource/Resources/TestToPrefabResource/JimAndBob.prefab new file mode 100644 index 000000000..ad5522946 --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefabResource/Resources/TestToPrefabResource/JimAndBob.prefab @@ -0,0 +1,64 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &124956 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 4: {fileID: 464534} + - 114: {fileID: 11479894} + - 114: {fileID: 11448468} + m_Layer: 0 + m_Name: JimAndBob + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &464534 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 124956} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 +--- !u!114 &11448468 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 124956} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 93bfc10f4bb073945911d600dea398a5, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!114 &11479894 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 124956} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 6dd802b9b69c51443af5311b06b79ca0, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!1001 &100100000 +Prefab: + m_ObjectHideFlags: 1 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: [] + m_RemovedComponents: [] + m_ParentPrefab: {fileID: 0} + m_RootGameObject: {fileID: 124956} + m_IsPrefabParent: 1 diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefabResource/Resources/TestToPrefabResource/JimAndBob.prefab.meta b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefabResource/Resources/TestToPrefabResource/JimAndBob.prefab.meta new file mode 100644 index 000000000..90c2a1773 --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefabResource/Resources/TestToPrefabResource/JimAndBob.prefab.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 588f499d9ffe8944da19657e601ffa61 +timeCreated: 1459015737 +licenseType: Pro +NativeFormatImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefabResource/Resources/TestToPrefabResource/Norf.prefab b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefabResource/Resources/TestToPrefabResource/Norf.prefab new file mode 100644 index 000000000..0f97a1d8e --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefabResource/Resources/TestToPrefabResource/Norf.prefab @@ -0,0 +1,76 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &199570 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 4: {fileID: 431222} + - 114: {fileID: 11458152} + - 114: {fileID: 11453902} + - 114: {fileID: 11417458} + m_Layer: 0 + m_Name: Norf + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &431222 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 199570} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 +--- !u!114 &11417458 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 199570} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: cf6600df40401e046af9c2ebfbf58b46, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!114 &11453902 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 199570} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 434e869aa9c49e046b97da50b0dfa819, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!114 &11458152 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 199570} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 434e869aa9c49e046b97da50b0dfa819, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!1001 &100100000 +Prefab: + m_ObjectHideFlags: 1 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: [] + m_RemovedComponents: [] + m_ParentPrefab: {fileID: 0} + m_RootGameObject: {fileID: 199570} + m_IsPrefabParent: 1 diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefabResource/Resources/TestToPrefabResource/Norf.prefab.meta b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefabResource/Resources/TestToPrefabResource/Norf.prefab.meta new file mode 100644 index 000000000..5bd6f4b20 --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefabResource/Resources/TestToPrefabResource/Norf.prefab.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: a4833165ddddda347b80b96e1a704b4e +timeCreated: 1459015737 +licenseType: Pro +NativeFormatImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefabResource/TestToPrefabResource.unity b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefabResource/TestToPrefabResource.unity new file mode 100644 index 000000000..51a7ac525 --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefabResource/TestToPrefabResource.unity @@ -0,0 +1,155 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!29 &1 +SceneSettings: + m_ObjectHideFlags: 0 + m_PVSData: + m_PVSObjectsArray: [] + m_PVSPortalsArray: [] + m_OcclusionBakeSettings: + smallestOccluder: 5 + smallestHole: 0.25 + backfaceThreshold: 100 +--- !u!104 &2 +RenderSettings: + m_ObjectHideFlags: 0 + serializedVersion: 6 + m_Fog: 0 + m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} + m_FogMode: 3 + m_FogDensity: 0.01 + m_LinearFogStart: 0 + m_LinearFogEnd: 300 + m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} + m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} + m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} + m_AmbientIntensity: 1 + m_AmbientMode: 0 + m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0} + m_HaloStrength: 0.5 + m_FlareStrength: 1 + m_FlareFadeSpeed: 3 + m_HaloTexture: {fileID: 0} + m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} + m_DefaultReflectionMode: 0 + m_DefaultReflectionResolution: 128 + m_ReflectionBounces: 1 + m_ReflectionIntensity: 1 + m_CustomReflection: {fileID: 0} + m_Sun: {fileID: 0} +--- !u!157 &3 +LightmapSettings: + m_ObjectHideFlags: 0 + serializedVersion: 6 + m_GIWorkflowMode: 0 + m_LightmapsMode: 1 + m_GISettings: + serializedVersion: 2 + m_BounceScale: 1 + m_IndirectOutputScale: 1 + m_AlbedoBoost: 1 + m_TemporalCoherenceThreshold: 1 + m_EnvironmentLightingMode: 0 + m_EnableBakedLightmaps: 1 + m_EnableRealtimeLightmaps: 1 + m_LightmapEditorSettings: + serializedVersion: 3 + m_Resolution: 2 + m_BakeResolution: 40 + m_TextureWidth: 1024 + m_TextureHeight: 1024 + m_AOMaxDistance: 1 + m_Padding: 2 + m_CompAOExponent: 0 + m_LightmapParameters: {fileID: 0} + m_TextureCompression: 1 + m_FinalGather: 0 + m_FinalGatherRayCount: 1024 + m_ReflectionCompression: 2 + m_LightingDataAsset: {fileID: 0} + m_RuntimeCPUUsage: 25 +--- !u!196 &4 +NavMeshSettings: + serializedVersion: 2 + m_ObjectHideFlags: 0 + m_BuildSettings: + serializedVersion: 2 + agentRadius: 0.5 + agentHeight: 2 + agentSlope: 45 + agentClimb: 0.4 + ledgeDropHeight: 0 + maxJumpAcrossDistance: 0 + accuratePlacement: 0 + minRegionArea: 2 + cellSize: 0.16666667 + manualCellSize: 0 + m_NavMeshData: {fileID: 0} +--- !u!1 &978433746 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 4 + m_Component: + - 4: {fileID: 978433749} + - 114: {fileID: 978433747} + - 114: {fileID: 978433750} + m_Layer: 0 + m_Name: SceneCompositionRoot + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &978433747 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 978433746} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 0e516af87ca41694bbaa70c373f993e0, type: 3} + m_Name: + m_EditorClassIdentifier: + _runAll: 1 + _testMethod: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 978433750} + m_MethodName: 546573745472616e7369656e744572726f72 + m_Mode: 1 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: 556e697479456e67696e652e4f626a6563742c20556e697479456e67696e65 + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 1 + m_TypeName: UnityEngine.Events.UnityEvent, UnityEngine, Version=0.0.0.0, Culture=neutral, + PublicKeyToken=null +--- !u!4 &978433749 +Transform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 978433746} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 +--- !u!114 &978433750 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 978433746} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4306a5fdd341f47499a87de2cb158a46, type: 3} + m_Name: + m_EditorClassIdentifier: diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefabResource/TestToPrefabResource.unity.meta b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefabResource/TestToPrefabResource.unity.meta new file mode 100644 index 000000000..bfd154a13 --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToPrefabResource/TestToPrefabResource.unity.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: a7f049aa3d573164eaafb42cac0eed54 +timeCreated: 1458255591 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToResource.meta b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToResource.meta new file mode 100644 index 000000000..1e2071747 --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToResource.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: c2773b71118022144941faaa397a4874 +folderAsset: yes +timeCreated: 1458258653 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToResource/Fixture.cs b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToResource/Fixture.cs new file mode 100644 index 000000000..0f2efed39 --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToResource/Fixture.cs @@ -0,0 +1,91 @@ +using System.Collections.Generic; +using ModestTree.UnityUnitTester; +using UnityEngine; +using Zenject; + +namespace ModestTree.Tests.Zenject.ToResource +{ + public class Fixture : MonoTestFixture + { + const string ResourcePath = "TestToResource/TestTexture"; + const string ResourcePath2 = "TestToResource/TestTexture2"; + + [Test] + public void TestBasic() + { + Container.Bind().FromResource(ResourcePath); + + Container.Bind().FromGameObject().AsSingle().WithArguments(1); + Container.BindRootResolve(); + } + + [Test] + public void TestTransient() + { + Container.Bind().FromResource(ResourcePath).AsTransient(); + Container.Bind().FromResource(ResourcePath); + Container.Bind().To().FromResource(ResourcePath); + + Container.Bind().FromGameObject().AsSingle().WithArguments(3); + Container.BindRootResolve(); + } + + [Test] + public void TestCached() + { + Container.Bind().FromResource(ResourcePath).AsCached(); + + Container.Bind().FromGameObject().AsSingle().WithArguments(1); + Container.BindRootResolve(); + } + + [Test] + public void TestSingle() + { + Container.Bind().FromResource(ResourcePath).AsSingle(); + Container.Bind().FromResource(ResourcePath).AsSingle(); + + Container.Bind().FromGameObject().AsSingle().WithArguments(2); + Container.BindRootResolve(); + } + + [Test] + [ExpectedException] + [ExpectedValidationException] + public void TestSingleWithError() + { + Container.Bind().FromResource(ResourcePath).AsSingle(); + Container.Bind().FromResource(ResourcePath2).AsSingle(); + + Container.Bind().FromGameObject().AsSingle().WithArguments(2); + Container.BindRootResolve(); + } + + public class Runner : MonoBehaviour + { + List _textures; + + [PostInject] + public void Construct(List textures, int expectedAmount) + { + _textures = textures; + + Assert.IsEqual(textures.Count, expectedAmount); + } + + void OnGUI() + { + int top = 0; + + foreach (var tex in _textures) + { + var rect = new Rect(0, top, Screen.width * 0.5f, Screen.height * 0.5f); + + GUI.DrawTexture(rect, tex); + + top += 200; + } + } + } + } +} diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToResource/Fixture.cs.meta b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToResource/Fixture.cs.meta new file mode 100644 index 000000000..bb91ebcd6 --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToResource/Fixture.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: f57a7c2484f55fe409373e5dc7c37a69 +timeCreated: 1458258911 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToResource/Resources.meta b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToResource/Resources.meta new file mode 100644 index 000000000..42a9dba9e --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToResource/Resources.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 9b025ceac67a6154fbbd08ef902d4f1d +folderAsset: yes +timeCreated: 1458258883 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToResource/Resources/TestToResource.meta b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToResource/Resources/TestToResource.meta new file mode 100644 index 000000000..aca0f056b --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToResource/Resources/TestToResource.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: a0e9026f52b719744a3a6faf1e1833a9 +folderAsset: yes +timeCreated: 1458258887 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToResource/Resources/TestToResource/TestTexture.png b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToResource/Resources/TestToResource/TestTexture.png new file mode 100644 index 0000000000000000000000000000000000000000..ae559b9708c7665a94bf2661a51b7944cc10fb0f GIT binary patch literal 13429 zcmaKTbC4#_w(ZxRwlQsM+ICOdw)wSfbK15w)3$Bfw#{k#_3zw!?tOo}^D3e$5qqt@ zbLWbz%8aNmd08=d7;G2-001u`F0A-f=6>Cs-$1{fy!HukU&VJP5p^deTN5W&0|y{L zz}VIhNGM@#UOKj%k zWXDBM@9OGG=gLfH>tIUH$jQn14+j$y?Ux0uqq~ihfg7!jBgwxRgn^Dm4(4`F=C(G3 z|1cUD+B!S&5`RVdUqi6A`yW~x$Nx^#SHkGs4D9F`=@|YQ(!UL5Wd8rA*4F=H?dYTk z{NH&0pTv&J?sh!%;fuj)mzzV(Gtvq5o%E|F3EOch{G8{;B?tXulf&BYU9Dm)0G= zMEx*&y959*oJj}^D7&qmdqZX74y4(txlWyrAL>}oR?b=^se+Iak;Vzfck4&o`sdhh z?*JNip77YF_DHLfO7q z@$h(Iv+-(cbP;uRl_QQz1$WbKczBqE!hf1rZLkFF`Mwlgfi3Sn8QzBlUqTU_`yA(e zc0M0|-pu8EfJX0(f4sv3fdvUDJgV>&Z+9m}dT;MnIb$O?UGERck6T+J--5fAbUhsv zMPh0&A_nxlZWcN_KMD&md?1b9uKQvL_`J$%YFfH{_1797!xmhwHoI)M@+AC*q;asY z-X>i?rfhv*L#)^MQh7beGdX?Q?fZh+x7k4lGvgmzJ0B%Jg{I=s-mGsFYibhAPGI zpWjCkWZq8Ro}HJp9myzS4^RUdChwwd4@I5?q)sB%0VzFi?y zS^U1Ta&oqomY(EWjteR&8y;se3>0rZpQPOyGlF^3Rle^}gHg6o^O$s+_1mXq^m-jH z?Kl26%aCqk$&dIR$Lv{I8zi{6)AwDUuQ9rIJ>jjbs}g=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vWE$BreghnK1@ z&;(vB}d{|j#&DH}?ZXQd!kLhrdd z%8f>}m@GTTm`O*WU)fz&=469ghH+~dBnkv}$$E%74>Dem;bGkoYuaO4Pio}P;1wwl eq=Qdb2EYaZ>VOt3zREv80!fI-3Rep12mBu&P-{E@ literal 0 HcmV?d00001 diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToResource/Resources/TestToResource/TestTexture.png.meta b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToResource/Resources/TestToResource/TestTexture.png.meta new file mode 100644 index 000000000..683ec6ad7 --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToResource/Resources/TestToResource/TestTexture.png.meta @@ -0,0 +1,57 @@ +fileFormatVersion: 2 +guid: 8de083ec593046642b2fa0c94a0bfd21 +timeCreated: 1456063223 +licenseType: Free +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + linearTexture: 0 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 7 + cubemapConvolutionExponent: 1.5 + seamlessCubemap: 0 + textureFormat: -1 + maxTextureSize: 2048 + textureSettings: + filterMode: -1 + aniso: -1 + mipBias: -1 + wrapMode: -1 + nPOTScale: 1 + lightmap: 0 + rGBM: 0 + compressionQuality: 50 + allowsAlphaSplitting: 0 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 0 + textureType: -1 + buildTargetSettings: [] + spriteSheet: + sprites: [] + outline: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToResource/Resources/TestToResource/TestTexture2.png b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToResource/Resources/TestToResource/TestTexture2.png new file mode 100644 index 0000000000000000000000000000000000000000..d888c32d5542372e6c193cbd59eb033c2876e15a GIT binary patch literal 17128 zcmV*IKxe;+P)006!S0ssI2J#mwf00001b5ch_0Itp) z=>Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>D02p*dSaefwW^{L9 za%BK;VQFr3E^cLXAT%y8E;(#7eog=YLRm>fK~#8N?VWd68&|sj9dCN#me{GAUN$|O zx^Xs6+~T<4ihDQ41vgy4rkUP52oMqy5=El--h1!8*rph8-|XFX_ujp~KYrgcXEY2W zu${zqOyE49M~@guGv~aY^Slm( z^5u*0WY(;i4?g%HJviBZBW=!{r_Id`AAb0ug$uut$vkGyeu{lzvi%0y#~;5h7Q4)y z`?-n9k%$N}`17B?U|*YT*X?co$d9sa{hVrYU z^ZoSc(_Vl56?$aq)Tw*-ZZkGM91}-M5#1c!7 zy!`TuOP0(J4))%?dvkPjkT%F^L9S1>`?Miz-Q28VV&p277^ZRL?YG}}`Q_h-g#~Qe zrt9HhgO^6-=uv%ohRJsSwog9!(8tFlT&DWlOdKP=t$#!qr+__(`S(ve@i^Oq$#$0-c0eai7^J61{X$Yw)Q}3bGMP_MkatLke{8H$ z@E&av6T?oQKKjWgAF;ieYoovrN_l#2MpPe1|%YmWP)X2od@aX8^@NnW7g0We{^SHQ>tgKkU z`^Q494np0YI&~`B#mV-w8#c62QHq?L#5+Y+R(x7obW#%XI8>zyQYulaMN%oswJ)AW zMh2&(L<&AK79k$}$#OLNF3*NwimsYM^#`b=)-Ml^Y(1R$IB_)~n4>>tW zSS%tV6?n|bN)Wutv2Wilb_|p4Ce6s`SXo)l{Yi3i6g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zIGRi1ffi&i0U6xar~*h|n!CIZ{6;_qU+;>z-VuJ|TrA=_I)bp@7Q+%DIF$#ZdH7|) z$AmC5OW0{JoYvh5v|Nv@*fB#*!IxUqS2|*;-J1x8T7YRGxWsrtXlo=W5;wZkH@YHz zJRkof$vgqVfZr6(8h}JLX{Y?yo5qkj4CkA?kN+_tBNuGyn{eaYFxTOj;Tp1;0fMoS zzSO3^(iwZXgMrj)!eC3(0C607u{pA@5o@rzryhw8yP7g}f1?%jTkx0j@z*<5H@c%o z>J-NLX0WAKfW}~N>Xg6srfEoJ>EVNSGj)43MlRUH+&DMP^=>#OTqBMNScxyUg%iQl zE>G}KYc%6H3WEEaBKjI5@Dgw2;~FhDBtsIecc}i-9V-az?Ep1nz|%(r_oZt{V;SLC z@Zk{%y36sG^TS+65;I&omq0().FromSubContainerResolve() + .ByPrefab(_fooPrefab).AsSingle(); + + Container.BindRootResolve(); + Container.BindRootResolve(); + Container.BindRootResolve(); + + FixtureUtil.AssertNumGameObjects(Container, 1); + FixtureUtil.AssertComponentCount(Container, 1); + } + + [Test] + public void TestSelfTransient() + { + Container.Bind().FromSubContainerResolve().ByPrefab(_fooPrefab).AsTransient(); + + Container.BindRootResolve(); + Container.BindRootResolve(); + Container.BindRootResolve(); + + FixtureUtil.AssertNumGameObjects(Container, 3); + FixtureUtil.AssertComponentCount(Container, 3); + } + + [Test] + public void TestSelfCached() + { + Container.Bind().FromSubContainerResolve().ByPrefab(_fooPrefab).AsCached(); + + Container.BindRootResolve(); + Container.BindRootResolve(); + Container.BindRootResolve(); + + FixtureUtil.AssertNumGameObjects(Container, 1); + FixtureUtil.AssertComponentCount(Container, 1); + } + + [Test] + public void TestSelfSingleMultipleContracts() + { + Container.Bind().FromSubContainerResolve().ByPrefab(_fooPrefab).AsSingle(); + Container.Bind().FromSubContainerResolve().ByPrefab(_fooPrefab).AsSingle(); + + Container.BindRootResolve(); + Container.BindRootResolve(); + + FixtureUtil.AssertNumGameObjects(Container, 1); + FixtureUtil.AssertComponentCount(Container, 1); + FixtureUtil.AssertComponentCount(Container, 1); + } + + [Test] + public void TestSelfCachedMultipleContracts() + { + Container.Bind(typeof(Foo), typeof(Bar)).FromSubContainerResolve().ByPrefab(_fooPrefab).AsCached(); + + Container.BindRootResolve(); + Container.BindRootResolve(); + + FixtureUtil.AssertNumGameObjects(Container, 1); + FixtureUtil.AssertComponentCount(Container, 1); + FixtureUtil.AssertComponentCount(Container, 1); + } + + [Test] + public void TestSelfTransientMultipleContracts() + { + Container.Bind(typeof(Foo), typeof(Bar)).FromSubContainerResolve().ByPrefab(_fooPrefab).AsTransient(); + + Container.BindRootResolve(); + Container.BindRootResolve(); + + FixtureUtil.AssertNumGameObjects(Container, 2); + FixtureUtil.AssertComponentCount(Container, 2); + FixtureUtil.AssertComponentCount(Container, 2); + } + + [Test] + public void TestConcreteSingle() + { + Container.Bind().To().FromSubContainerResolve().ByPrefab(_fooPrefab).AsSingle(); + + Container.BindRootResolve(); + Container.BindRootResolve(); + Container.BindRootResolve(); + + FixtureUtil.AssertNumGameObjects(Container, 1); + FixtureUtil.AssertComponentCount(Container, 1); + } + + [Test] + public void TestConcreteTransient() + { + Container.Bind().To().FromSubContainerResolve().ByPrefab(_fooPrefab).AsTransient(); + + Container.BindRootResolve(); + Container.BindRootResolve(); + Container.BindRootResolve(); + + FixtureUtil.AssertNumGameObjects(Container, 3); + FixtureUtil.AssertComponentCount(Container, 3); + } + + [Test] + public void TestConcreteCached() + { + Container.Bind().To().FromSubContainerResolve().ByPrefab(_fooPrefab).AsCached(); + + Container.BindRootResolve(); + Container.BindRootResolve(); + Container.BindRootResolve(); + + FixtureUtil.AssertNumGameObjects(Container, 1); + FixtureUtil.AssertComponentCount(Container, 1); + } + + [Test] + public void TestConcreteSingleMultipleContracts() + { + Container.Bind().To().FromSubContainerResolve().ByPrefab(_fooPrefab).AsSingle(); + Container.Bind().FromSubContainerResolve().ByPrefab(_fooPrefab).AsSingle(); + + Container.BindRootResolve(); + Container.BindRootResolve(); + Container.BindRootResolve(); + Container.BindRootResolve(); + Container.BindRootResolve(); + + FixtureUtil.AssertNumGameObjects(Container, 1); + FixtureUtil.AssertComponentCount(Container, 1); + FixtureUtil.AssertComponentCount(Container, 1); + } + + [Test] + public void TestConcreteCachedMultipleContracts() + { + Container.Bind(typeof(Foo), typeof(IFoo)).To().FromSubContainerResolve().ByPrefab(_fooPrefab).AsCached(); + + Container.BindRootResolve(); + Container.BindRootResolve(); + Container.BindRootResolve(); + Container.BindRootResolve(); + Container.BindRootResolve(); + + FixtureUtil.AssertNumGameObjects(Container, 1); + FixtureUtil.AssertComponentCount(Container, 1); + } + + [Test] + [ExpectedException] + [ExpectedValidationException] + public void TestSelfIdentifiersFails() + { + Container.Bind().FromSubContainerResolve().ByPrefab(_fooPrefab).AsSingle(); + + Container.BindRootResolve(); + } + + [Test] + public void TestSelfIdentifiers() + { + Container.Bind().FromSubContainerResolve("gorp").ByPrefab(_fooPrefab).AsSingle(); + + Container.BindRootResolve(); + Container.BindRootResolve(); + + FixtureUtil.AssertNumGameObjects(Container, 1); + } + } +} diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToSubContainerPrefab/Fixture.cs.meta b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToSubContainerPrefab/Fixture.cs.meta new file mode 100644 index 000000000..4bc0381ea --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToSubContainerPrefab/Fixture.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 42de6818a6bb1bb42864b50b58cdcd7a +timeCreated: 1460507335 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToSubContainerPrefab/Foo.cs b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToSubContainerPrefab/Foo.cs new file mode 100644 index 000000000..2790e0b4e --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToSubContainerPrefab/Foo.cs @@ -0,0 +1,12 @@ +using UnityEngine; + +namespace ModestTree.Tests.Zenject.ToSubContainerPrefab +{ + public interface IFoo + { + } + + public class Foo : MonoBehaviour, IFoo + { + } +} diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToSubContainerPrefab/Foo.cs.meta b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToSubContainerPrefab/Foo.cs.meta new file mode 100644 index 000000000..94c723c39 --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToSubContainerPrefab/Foo.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 6997e435baf0c60488bc2bc179014813 +timeCreated: 1460508139 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToSubContainerPrefab/Foo.prefab b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToSubContainerPrefab/Foo.prefab new file mode 100644 index 000000000..f87b07515 --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToSubContainerPrefab/Foo.prefab @@ -0,0 +1,139 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &151926 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 4: {fileID: 436462} + - 114: {fileID: 11426760} + - 114: {fileID: 11423502} + m_Layer: 0 + m_Name: Foo + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &162920 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 4: {fileID: 406566} + - 114: {fileID: 11460120} + - 114: {fileID: 11429022} + - 114: {fileID: 11473484} + m_Layer: 0 + m_Name: Foo + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &406566 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 162920} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 436462} + m_Father: {fileID: 0} + m_RootOrder: 0 +--- !u!4 &436462 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 151926} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 406566} + m_RootOrder: 0 +--- !u!114 &11423502 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 151926} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 0166d8ff8d905b048b2448179e1f5d11, type: 3} + m_Name: + m_EditorClassIdentifier: + _components: + - {fileID: 11426760} + _identifier: + _compositionRoot: {fileID: 0} + _bindType: 0 +--- !u!114 &11426760 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 151926} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 6997e435baf0c60488bc2bc179014813, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!114 &11429022 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 162920} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 2161a6f5a67bb7749bb74037a259ca72, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!114 &11460120 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 162920} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 08eca9f7688a0a24685b89133b020c8e, type: 3} + m_Name: + m_EditorClassIdentifier: + _installers: + - {fileID: 11473484} + _installerPrefabs: [] + _scriptableObjectInstallers: [] + _facade: {fileID: 0} +--- !u!114 &11473484 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 162920} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 0a2394e0baff5a347bdf60d1c2c913d1, type: 3} + m_Name: + m_EditorClassIdentifier: + _bar: {fileID: 11429022} +--- !u!1001 &100100000 +Prefab: + m_ObjectHideFlags: 1 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: [] + m_RemovedComponents: [] + m_ParentPrefab: {fileID: 0} + m_RootGameObject: {fileID: 162920} + m_IsPrefabParent: 1 diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToSubContainerPrefab/Foo.prefab.meta b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToSubContainerPrefab/Foo.prefab.meta new file mode 100644 index 000000000..222002b23 --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToSubContainerPrefab/Foo.prefab.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 878b989aa92d3654f8507e4880b04678 +timeCreated: 1460509291 +licenseType: Pro +NativeFormatImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToSubContainerPrefab/FooInstaller.cs b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToSubContainerPrefab/FooInstaller.cs new file mode 100644 index 000000000..55d0772f3 --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToSubContainerPrefab/FooInstaller.cs @@ -0,0 +1,18 @@ +using UnityEngine; +using System.Collections; +using Zenject; + +namespace ModestTree.Tests.Zenject.ToSubContainerPrefab +{ + public class FooInstaller : MonoInstaller + { + [SerializeField] + Bar _bar; + + public override void InstallBindings() + { + Container.BindInstance(_bar); + Container.Bind("gorp").AsSingle(); + } + } +} diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToSubContainerPrefab/FooInstaller.cs.meta b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToSubContainerPrefab/FooInstaller.cs.meta new file mode 100644 index 000000000..9ded5b7c1 --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToSubContainerPrefab/FooInstaller.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 0a2394e0baff5a347bdf60d1c2c913d1 +timeCreated: 1460644513 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToSubContainerPrefab/Gorp.cs b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToSubContainerPrefab/Gorp.cs new file mode 100644 index 000000000..f9881edb0 --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToSubContainerPrefab/Gorp.cs @@ -0,0 +1,9 @@ +using UnityEngine; + +namespace ModestTree.Tests.Zenject.ToSubContainerPrefab +{ + public class Gorp + { + } +} + diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToSubContainerPrefab/Gorp.cs.meta b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToSubContainerPrefab/Gorp.cs.meta new file mode 100644 index 000000000..bad574f02 --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToSubContainerPrefab/Gorp.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: e7443e55301b94c48944434e69fb7828 +timeCreated: 1460644406 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToSubContainerPrefab/TestToSubContainerPrefab.unity b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToSubContainerPrefab/TestToSubContainerPrefab.unity new file mode 100644 index 000000000..e6768b56a --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToSubContainerPrefab/TestToSubContainerPrefab.unity @@ -0,0 +1,156 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!29 &1 +SceneSettings: + m_ObjectHideFlags: 0 + m_PVSData: + m_PVSObjectsArray: [] + m_PVSPortalsArray: [] + m_OcclusionBakeSettings: + smallestOccluder: 5 + smallestHole: 0.25 + backfaceThreshold: 100 +--- !u!104 &2 +RenderSettings: + m_ObjectHideFlags: 0 + serializedVersion: 6 + m_Fog: 0 + m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} + m_FogMode: 3 + m_FogDensity: 0.01 + m_LinearFogStart: 0 + m_LinearFogEnd: 300 + m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} + m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} + m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} + m_AmbientIntensity: 1 + m_AmbientMode: 0 + m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0} + m_HaloStrength: 0.5 + m_FlareStrength: 1 + m_FlareFadeSpeed: 3 + m_HaloTexture: {fileID: 0} + m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} + m_DefaultReflectionMode: 0 + m_DefaultReflectionResolution: 128 + m_ReflectionBounces: 1 + m_ReflectionIntensity: 1 + m_CustomReflection: {fileID: 0} + m_Sun: {fileID: 0} +--- !u!157 &3 +LightmapSettings: + m_ObjectHideFlags: 0 + serializedVersion: 6 + m_GIWorkflowMode: 0 + m_LightmapsMode: 1 + m_GISettings: + serializedVersion: 2 + m_BounceScale: 1 + m_IndirectOutputScale: 1 + m_AlbedoBoost: 1 + m_TemporalCoherenceThreshold: 1 + m_EnvironmentLightingMode: 0 + m_EnableBakedLightmaps: 1 + m_EnableRealtimeLightmaps: 1 + m_LightmapEditorSettings: + serializedVersion: 3 + m_Resolution: 2 + m_BakeResolution: 40 + m_TextureWidth: 1024 + m_TextureHeight: 1024 + m_AOMaxDistance: 1 + m_Padding: 2 + m_CompAOExponent: 0 + m_LightmapParameters: {fileID: 0} + m_TextureCompression: 1 + m_FinalGather: 0 + m_FinalGatherRayCount: 1024 + m_ReflectionCompression: 2 + m_LightingDataAsset: {fileID: 0} + m_RuntimeCPUUsage: 25 +--- !u!196 &4 +NavMeshSettings: + serializedVersion: 2 + m_ObjectHideFlags: 0 + m_BuildSettings: + serializedVersion: 2 + agentRadius: 0.5 + agentHeight: 2 + agentSlope: 45 + agentClimb: 0.4 + ledgeDropHeight: 0 + maxJumpAcrossDistance: 0 + accuratePlacement: 0 + minRegionArea: 2 + cellSize: 0.16666667 + manualCellSize: 0 + m_NavMeshData: {fileID: 0} +--- !u!1 &42935781 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 4 + m_Component: + - 4: {fileID: 42935785} + - 114: {fileID: 42935783} + - 114: {fileID: 42935782} + m_Layer: 0 + m_Name: SceneCompositionRoot + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &42935782 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 42935781} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 42de6818a6bb1bb42864b50b58cdcd7a, type: 3} + m_Name: + m_EditorClassIdentifier: + _fooPrefab: {fileID: 162920, guid: 878b989aa92d3654f8507e4880b04678, type: 2} +--- !u!114 &42935783 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 42935781} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 0e516af87ca41694bbaa70c373f993e0, type: 3} + m_Name: + m_EditorClassIdentifier: + _runAll: 1 + _testMethod: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 42935782} + m_MethodName: TestSelfSingle + m_Mode: 1 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 1 + m_TypeName: UnityEngine.Events.UnityEvent, UnityEngine, Version=0.0.0.0, Culture=neutral, + PublicKeyToken=null +--- !u!4 &42935785 +Transform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 42935781} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToSubContainerPrefab/TestToSubContainerPrefab.unity.meta b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToSubContainerPrefab/TestToSubContainerPrefab.unity.meta new file mode 100644 index 000000000..9c4ce78cd --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToSubContainerPrefab/TestToSubContainerPrefab.unity.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 0bc0bb033bb3a6241a4ddfc6cb236142 +timeCreated: 1460507308 +licenseType: Pro +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToSubContainerPrefabResource.meta b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToSubContainerPrefabResource.meta new file mode 100644 index 000000000..e6bdcf5ca --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToSubContainerPrefabResource.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: f8bf6921de58d4e4cae8ef709e6a8994 +folderAsset: yes +timeCreated: 1460654570 +licenseType: Pro +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToSubContainerPrefabResource/Bar.cs b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToSubContainerPrefabResource/Bar.cs new file mode 100644 index 000000000..24e957292 --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToSubContainerPrefabResource/Bar.cs @@ -0,0 +1,9 @@ +using UnityEngine; + +namespace ModestTree.Tests.Zenject.ToSubContainerPrefabResource +{ + public class Bar : MonoBehaviour + { + } +} + diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToSubContainerPrefabResource/Bar.cs.meta b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToSubContainerPrefabResource/Bar.cs.meta new file mode 100644 index 000000000..cf891cf47 --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToSubContainerPrefabResource/Bar.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 850feee7ebf0de346ba632c2b2abdc64 +timeCreated: 1460654591 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToSubContainerPrefabResource/Fixture.cs b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToSubContainerPrefabResource/Fixture.cs new file mode 100644 index 000000000..d5a1a96db --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToSubContainerPrefabResource/Fixture.cs @@ -0,0 +1,195 @@ +using System.Collections.Generic; +using ModestTree.UnityUnitTester; +using UnityEngine; +using Zenject; + +namespace ModestTree.Tests.Zenject.ToSubContainerPrefabResource +{ + public class Fixture : MonoTestFixture + { + const string PathPrefix = "ToSubContainerPrefabResource/"; + const string FooResourcePath = PathPrefix + "FooSubContainer"; + + [Test] + [ExpectedException] + [ExpectedValidationException] + public void TestTransientError() + { + // Validation should detect that it doesn't exist + Container.Bind().FromSubContainerResolve().ByPrefabResource(PathPrefix + "asdfasdfas").AsTransient(); + + Container.BindRootResolve(); + } + + [Test] + public void TestSelfSingle() + { + Container.Bind().FromSubContainerResolve().ByPrefabResource(FooResourcePath).AsSingle(); + + Container.BindRootResolve(); + Container.BindRootResolve(); + Container.BindRootResolve(); + + FixtureUtil.AssertNumGameObjects(Container, 1); + FixtureUtil.AssertComponentCount(Container, 1); + } + + [Test] + public void TestSelfTransient() + { + Container.Bind().FromSubContainerResolve().ByPrefabResource(FooResourcePath).AsTransient(); + + Container.BindRootResolve(); + Container.BindRootResolve(); + Container.BindRootResolve(); + + FixtureUtil.AssertNumGameObjects(Container, 3); + FixtureUtil.AssertComponentCount(Container, 3); + } + + [Test] + public void TestSelfCached() + { + Container.Bind().FromSubContainerResolve().ByPrefabResource(FooResourcePath).AsCached(); + + Container.BindRootResolve(); + Container.BindRootResolve(); + Container.BindRootResolve(); + + FixtureUtil.AssertNumGameObjects(Container, 1); + FixtureUtil.AssertComponentCount(Container, 1); + } + + [Test] + public void TestSelfSingleMultipleContracts() + { + Container.Bind().FromSubContainerResolve().ByPrefabResource(FooResourcePath).AsSingle(); + Container.Bind().FromSubContainerResolve().ByPrefabResource(FooResourcePath).AsSingle(); + + Container.BindRootResolve(); + Container.BindRootResolve(); + + FixtureUtil.AssertNumGameObjects(Container, 1); + FixtureUtil.AssertComponentCount(Container, 1); + FixtureUtil.AssertComponentCount(Container, 1); + } + + [Test] + public void TestSelfCachedMultipleContracts() + { + Container.Bind(typeof(Foo), typeof(Bar)).FromSubContainerResolve().ByPrefabResource(FooResourcePath).AsCached(); + + Container.BindRootResolve(); + Container.BindRootResolve(); + + FixtureUtil.AssertNumGameObjects(Container, 1); + FixtureUtil.AssertComponentCount(Container, 1); + FixtureUtil.AssertComponentCount(Container, 1); + } + + [Test] + public void TestSelfTransientMultipleContracts() + { + Container.Bind(typeof(Foo), typeof(Bar)).FromSubContainerResolve().ByPrefabResource(FooResourcePath).AsTransient(); + + Container.BindRootResolve(); + Container.BindRootResolve(); + + FixtureUtil.AssertNumGameObjects(Container, 2); + FixtureUtil.AssertComponentCount(Container, 2); + FixtureUtil.AssertComponentCount(Container, 2); + } + + [Test] + public void TestConcreteSingle() + { + Container.Bind().To().FromSubContainerResolve().ByPrefabResource(FooResourcePath).AsSingle(); + + Container.BindRootResolve(); + Container.BindRootResolve(); + Container.BindRootResolve(); + + FixtureUtil.AssertNumGameObjects(Container, 1); + FixtureUtil.AssertComponentCount(Container, 1); + } + + [Test] + public void TestConcreteTransient() + { + Container.Bind().To().FromSubContainerResolve().ByPrefabResource(FooResourcePath).AsTransient(); + + Container.BindRootResolve(); + Container.BindRootResolve(); + Container.BindRootResolve(); + + FixtureUtil.AssertNumGameObjects(Container, 3); + FixtureUtil.AssertComponentCount(Container, 3); + } + + [Test] + public void TestConcreteCached() + { + Container.Bind().To().FromSubContainerResolve().ByPrefabResource(FooResourcePath).AsCached(); + + Container.BindRootResolve(); + Container.BindRootResolve(); + Container.BindRootResolve(); + + FixtureUtil.AssertNumGameObjects(Container, 1); + FixtureUtil.AssertComponentCount(Container, 1); + } + + [Test] + public void TestConcreteSingleMultipleContracts() + { + Container.Bind().To().FromSubContainerResolve().ByPrefabResource(FooResourcePath).AsSingle(); + Container.Bind().FromSubContainerResolve().ByPrefabResource(FooResourcePath).AsSingle(); + + Container.BindRootResolve(); + Container.BindRootResolve(); + Container.BindRootResolve(); + Container.BindRootResolve(); + Container.BindRootResolve(); + + FixtureUtil.AssertNumGameObjects(Container, 1); + FixtureUtil.AssertComponentCount(Container, 1); + FixtureUtil.AssertComponentCount(Container, 1); + } + + [Test] + public void TestConcreteCachedMultipleContracts() + { + Container.Bind(typeof(Foo), typeof(IFoo)).To().FromSubContainerResolve().ByPrefabResource(FooResourcePath).AsCached(); + + Container.BindRootResolve(); + Container.BindRootResolve(); + Container.BindRootResolve(); + Container.BindRootResolve(); + Container.BindRootResolve(); + + FixtureUtil.AssertNumGameObjects(Container, 1); + FixtureUtil.AssertComponentCount(Container, 1); + } + + [Test] + [ExpectedException] + [ExpectedValidationException] + public void TestSelfIdentifiersFails() + { + Container.Bind().FromSubContainerResolve().ByPrefabResource(FooResourcePath).AsSingle(); + + Container.BindRootResolve(); + } + + [Test] + public void TestSelfIdentifiers() + { + Container.Bind().FromSubContainerResolve("gorp").ByPrefabResource(FooResourcePath).AsSingle(); + + Container.BindRootResolve(); + Container.BindRootResolve(); + + FixtureUtil.AssertNumGameObjects(Container, 1); + } + } +} diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToSubContainerPrefabResource/Fixture.cs.meta b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToSubContainerPrefabResource/Fixture.cs.meta new file mode 100644 index 000000000..1fe64dd99 --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToSubContainerPrefabResource/Fixture.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: cb19f83a1a7aa2a4ab76bc3681bacb33 +timeCreated: 1460654592 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToSubContainerPrefabResource/Foo.cs b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToSubContainerPrefabResource/Foo.cs new file mode 100644 index 000000000..e0f1a96a4 --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToSubContainerPrefabResource/Foo.cs @@ -0,0 +1,12 @@ +using UnityEngine; + +namespace ModestTree.Tests.Zenject.ToSubContainerPrefabResource +{ + public interface IFoo + { + } + + public class Foo : MonoBehaviour, IFoo + { + } +} diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToSubContainerPrefabResource/Foo.cs.meta b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToSubContainerPrefabResource/Foo.cs.meta new file mode 100644 index 000000000..148bf5762 --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToSubContainerPrefabResource/Foo.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: b3d9dd215537204498109ca7ed42833c +timeCreated: 1460654592 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToSubContainerPrefabResource/FooInstaller.cs b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToSubContainerPrefabResource/FooInstaller.cs new file mode 100644 index 000000000..eb97e7df7 --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToSubContainerPrefabResource/FooInstaller.cs @@ -0,0 +1,18 @@ +using UnityEngine; +using System.Collections; +using Zenject; + +namespace ModestTree.Tests.Zenject.ToSubContainerPrefabResource +{ + public class FooInstaller : MonoInstaller + { + [SerializeField] + Bar _bar; + + public override void InstallBindings() + { + Container.BindInstance(_bar); + Container.Bind("gorp").AsSingle(); + } + } +} diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToSubContainerPrefabResource/FooInstaller.cs.meta b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToSubContainerPrefabResource/FooInstaller.cs.meta new file mode 100644 index 000000000..89e3ff664 --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToSubContainerPrefabResource/FooInstaller.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: a30bc985de2744a49add38b40ccf532a +timeCreated: 1460654592 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToSubContainerPrefabResource/Gorp.cs b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToSubContainerPrefabResource/Gorp.cs new file mode 100644 index 000000000..2265fcf0a --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToSubContainerPrefabResource/Gorp.cs @@ -0,0 +1,9 @@ +using UnityEngine; + +namespace ModestTree.Tests.Zenject.ToSubContainerPrefabResource +{ + public class Gorp + { + } +} + diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToSubContainerPrefabResource/Gorp.cs.meta b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToSubContainerPrefabResource/Gorp.cs.meta new file mode 100644 index 000000000..3b94dddfb --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToSubContainerPrefabResource/Gorp.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: ddd55da12d9bf754fb0752461ce83ab7 +timeCreated: 1460654592 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToSubContainerPrefabResource/Resources.meta b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToSubContainerPrefabResource/Resources.meta new file mode 100644 index 000000000..fc4f5c0e3 --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToSubContainerPrefabResource/Resources.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: f0777618bfbe35a428414971e526b9b2 +folderAsset: yes +timeCreated: 1460654581 +licenseType: Pro +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToSubContainerPrefabResource/Resources/ToSubContainerPrefabResource.meta b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToSubContainerPrefabResource/Resources/ToSubContainerPrefabResource.meta new file mode 100644 index 000000000..46c54b338 --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToSubContainerPrefabResource/Resources/ToSubContainerPrefabResource.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: b7bbc41a31e80f44fad482d1305b62f5 +folderAsset: yes +timeCreated: 1460654658 +licenseType: Pro +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToSubContainerPrefabResource/Resources/ToSubContainerPrefabResource/FooSubContainer.prefab b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToSubContainerPrefabResource/Resources/ToSubContainerPrefabResource/FooSubContainer.prefab new file mode 100644 index 000000000..6e23ed205 --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToSubContainerPrefabResource/Resources/ToSubContainerPrefabResource/FooSubContainer.prefab @@ -0,0 +1,139 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &151926 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 4: {fileID: 436462} + - 114: {fileID: 11413310} + - 114: {fileID: 11423502} + m_Layer: 0 + m_Name: Foo + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &162920 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 4: {fileID: 406566} + - 114: {fileID: 11460120} + - 114: {fileID: 11497872} + - 114: {fileID: 11477890} + m_Layer: 0 + m_Name: FooSubContainer + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &406566 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 162920} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: -37.141693, y: 4.1177154, z: 8.340115} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 436462} + m_Father: {fileID: 0} + m_RootOrder: 0 +--- !u!4 &436462 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 151926} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 406566} + m_RootOrder: 0 +--- !u!114 &11413310 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 151926} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: b3d9dd215537204498109ca7ed42833c, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!114 &11423502 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 151926} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 0166d8ff8d905b048b2448179e1f5d11, type: 3} + m_Name: + m_EditorClassIdentifier: + _components: + - {fileID: 11413310} + _identifier: + _compositionRoot: {fileID: 0} + _bindType: 0 +--- !u!114 &11460120 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 162920} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 08eca9f7688a0a24685b89133b020c8e, type: 3} + m_Name: + m_EditorClassIdentifier: + _installers: + - {fileID: 11497872} + _installerPrefabs: [] + _scriptableObjectInstallers: [] + _facade: {fileID: 0} +--- !u!114 &11477890 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 162920} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 850feee7ebf0de346ba632c2b2abdc64, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!114 &11497872 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 162920} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: a30bc985de2744a49add38b40ccf532a, type: 3} + m_Name: + m_EditorClassIdentifier: + _bar: {fileID: 11477890} +--- !u!1001 &100100000 +Prefab: + m_ObjectHideFlags: 1 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: [] + m_RemovedComponents: [] + m_ParentPrefab: {fileID: 0} + m_RootGameObject: {fileID: 162920} + m_IsPrefabParent: 1 diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToSubContainerPrefabResource/Resources/ToSubContainerPrefabResource/FooSubContainer.prefab.meta b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToSubContainerPrefabResource/Resources/ToSubContainerPrefabResource/FooSubContainer.prefab.meta new file mode 100644 index 000000000..0474d5af4 --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToSubContainerPrefabResource/Resources/ToSubContainerPrefabResource/FooSubContainer.prefab.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: c9bcc6f4dae8ac247a0198aeef995c13 +timeCreated: 1460654592 +licenseType: Pro +NativeFormatImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToSubContainerPrefabResource/TestToSubContainerPrefabResource.unity b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToSubContainerPrefabResource/TestToSubContainerPrefabResource.unity new file mode 100644 index 000000000..a38297c48 --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToSubContainerPrefabResource/TestToSubContainerPrefabResource.unity @@ -0,0 +1,155 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!29 &1 +SceneSettings: + m_ObjectHideFlags: 0 + m_PVSData: + m_PVSObjectsArray: [] + m_PVSPortalsArray: [] + m_OcclusionBakeSettings: + smallestOccluder: 5 + smallestHole: 0.25 + backfaceThreshold: 100 +--- !u!104 &2 +RenderSettings: + m_ObjectHideFlags: 0 + serializedVersion: 6 + m_Fog: 0 + m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} + m_FogMode: 3 + m_FogDensity: 0.01 + m_LinearFogStart: 0 + m_LinearFogEnd: 300 + m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} + m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} + m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} + m_AmbientIntensity: 1 + m_AmbientMode: 0 + m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0} + m_HaloStrength: 0.5 + m_FlareStrength: 1 + m_FlareFadeSpeed: 3 + m_HaloTexture: {fileID: 0} + m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} + m_DefaultReflectionMode: 0 + m_DefaultReflectionResolution: 128 + m_ReflectionBounces: 1 + m_ReflectionIntensity: 1 + m_CustomReflection: {fileID: 0} + m_Sun: {fileID: 0} +--- !u!157 &3 +LightmapSettings: + m_ObjectHideFlags: 0 + serializedVersion: 6 + m_GIWorkflowMode: 0 + m_LightmapsMode: 1 + m_GISettings: + serializedVersion: 2 + m_BounceScale: 1 + m_IndirectOutputScale: 1 + m_AlbedoBoost: 1 + m_TemporalCoherenceThreshold: 1 + m_EnvironmentLightingMode: 0 + m_EnableBakedLightmaps: 1 + m_EnableRealtimeLightmaps: 1 + m_LightmapEditorSettings: + serializedVersion: 3 + m_Resolution: 2 + m_BakeResolution: 40 + m_TextureWidth: 1024 + m_TextureHeight: 1024 + m_AOMaxDistance: 1 + m_Padding: 2 + m_CompAOExponent: 0 + m_LightmapParameters: {fileID: 0} + m_TextureCompression: 1 + m_FinalGather: 0 + m_FinalGatherRayCount: 1024 + m_ReflectionCompression: 2 + m_LightingDataAsset: {fileID: 0} + m_RuntimeCPUUsage: 25 +--- !u!196 &4 +NavMeshSettings: + serializedVersion: 2 + m_ObjectHideFlags: 0 + m_BuildSettings: + serializedVersion: 2 + agentRadius: 0.5 + agentHeight: 2 + agentSlope: 45 + agentClimb: 0.4 + ledgeDropHeight: 0 + maxJumpAcrossDistance: 0 + accuratePlacement: 0 + minRegionArea: 2 + cellSize: 0.16666667 + manualCellSize: 0 + m_NavMeshData: {fileID: 0} +--- !u!1 &42935781 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 4 + m_Component: + - 4: {fileID: 42935785} + - 114: {fileID: 42935783} + - 114: {fileID: 42935782} + m_Layer: 0 + m_Name: SceneCompositionRoot + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &42935782 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 42935781} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: cb19f83a1a7aa2a4ab76bc3681bacb33, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!114 &42935783 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 42935781} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 0e516af87ca41694bbaa70c373f993e0, type: 3} + m_Name: + m_EditorClassIdentifier: + _runAll: 1 + _testMethod: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 42935782} + m_MethodName: + m_Mode: 1 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 1 + m_TypeName: UnityEngine.Events.UnityEvent, UnityEngine, Version=0.0.0.0, Culture=neutral, + PublicKeyToken=null +--- !u!4 &42935785 +Transform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 42935781} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToSubContainerPrefabResource/TestToSubContainerPrefabResource.unity.meta b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToSubContainerPrefabResource/TestToSubContainerPrefabResource.unity.meta new file mode 100644 index 000000000..42eb11189 --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Bindings/TestToSubContainerPrefabResource/TestToSubContainerPrefabResource.unity.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 9427c09e3f2c1304fbe67d8c62fe82ed +timeCreated: 1460654591 +licenseType: Pro +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories.meta b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories.meta new file mode 100644 index 000000000..c313716dd --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 1cb0b193dc8027b4eba4d3cd4e935076 +folderAsset: yes +timeCreated: 1462057592 +licenseType: Pro +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/PrefabFactory.meta b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/PrefabFactory.meta new file mode 100644 index 000000000..aad56df31 --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/PrefabFactory.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 0d2ec9fa00b238343bfe6aed69180d7b +folderAsset: yes +timeCreated: 1461165656 +licenseType: Pro +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/PrefabFactory/Fixture.cs b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/PrefabFactory/Fixture.cs new file mode 100644 index 000000000..ae55cc8b1 --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/PrefabFactory/Fixture.cs @@ -0,0 +1,43 @@ +using ModestTree.UnityUnitTester; +using UnityEngine; +using Zenject; + +namespace ModestTree.Tests.Zenject.TestPrefabFactory +{ + public class Fixture : MonoTestFixture + { + public GameObject FooPrefab; + + [Test] + public void Test1() + { + Container.Bind().ToSelf().AsSingle(); + Container.Bind().To().AsSingle().WithArguments(FooPrefab); + } + + public class FooFactory : PrefabFactory + { + } + + public class Runner : IInitializable + { + readonly GameObject _prefab; + readonly FooFactory _fooFactory; + + public Runner( + FooFactory fooFactory, + GameObject prefab) + { + _prefab = prefab; + _fooFactory = fooFactory; + } + + public void Initialize() + { + var foo = _fooFactory.Create(_prefab); + + Assert.That(foo.WasInitialized); + } + } + } +} diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/PrefabFactory/Fixture.cs.meta b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/PrefabFactory/Fixture.cs.meta new file mode 100644 index 000000000..c6f6b44f0 --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/PrefabFactory/Fixture.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: d7659c77abc45bc4c8e6246b1c584bbf +timeCreated: 1461165705 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/PrefabFactory/Foo.cs b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/PrefabFactory/Foo.cs new file mode 100644 index 000000000..c7cad9373 --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/PrefabFactory/Foo.cs @@ -0,0 +1,17 @@ +using System; +using Zenject; +using UnityEngine; + +namespace ModestTree.Tests.Zenject.TestPrefabFactory +{ + public class Foo : MonoBehaviour + { + public bool WasInitialized; + + [PostInject] + public void Init() + { + WasInitialized = true; + } + } +} diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/PrefabFactory/Foo.cs.meta b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/PrefabFactory/Foo.cs.meta new file mode 100644 index 000000000..bf76f58c6 --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/PrefabFactory/Foo.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 724cacdf997720a47b671d0a4dc6bb0f +timeCreated: 1461166024 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/PrefabFactory/Foo.prefab b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/PrefabFactory/Foo.prefab new file mode 100644 index 000000000..c24a78095 --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/PrefabFactory/Foo.prefab @@ -0,0 +1,53 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &130070 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 4: {fileID: 462884} + - 114: {fileID: 11421454} + m_Layer: 0 + m_Name: Foo + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &462884 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 130070} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: -37.141693, y: 4.1177154, z: 8.340115} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 +--- !u!114 &11421454 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 130070} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 724cacdf997720a47b671d0a4dc6bb0f, type: 3} + m_Name: + m_EditorClassIdentifier: + WasInitialized: 0 +--- !u!1001 &100100000 +Prefab: + m_ObjectHideFlags: 1 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: [] + m_RemovedComponents: [] + m_ParentPrefab: {fileID: 0} + m_RootGameObject: {fileID: 130070} + m_IsPrefabParent: 1 diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/PrefabFactory/Foo.prefab.meta b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/PrefabFactory/Foo.prefab.meta new file mode 100644 index 000000000..d8854f9e9 --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/PrefabFactory/Foo.prefab.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 54246954ae9afed40ad0e818f0d1702c +timeCreated: 1461166035 +licenseType: Pro +NativeFormatImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/PrefabFactory/TestPrefabFactory.unity b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/PrefabFactory/TestPrefabFactory.unity new file mode 100644 index 000000000..41f0849dd --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/PrefabFactory/TestPrefabFactory.unity @@ -0,0 +1,156 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!29 &1 +SceneSettings: + m_ObjectHideFlags: 0 + m_PVSData: + m_PVSObjectsArray: [] + m_PVSPortalsArray: [] + m_OcclusionBakeSettings: + smallestOccluder: 5 + smallestHole: 0.25 + backfaceThreshold: 100 +--- !u!104 &2 +RenderSettings: + m_ObjectHideFlags: 0 + serializedVersion: 6 + m_Fog: 0 + m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} + m_FogMode: 3 + m_FogDensity: 0.01 + m_LinearFogStart: 0 + m_LinearFogEnd: 300 + m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} + m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} + m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} + m_AmbientIntensity: 1 + m_AmbientMode: 0 + m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0} + m_HaloStrength: 0.5 + m_FlareStrength: 1 + m_FlareFadeSpeed: 3 + m_HaloTexture: {fileID: 0} + m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} + m_DefaultReflectionMode: 0 + m_DefaultReflectionResolution: 128 + m_ReflectionBounces: 1 + m_ReflectionIntensity: 1 + m_CustomReflection: {fileID: 0} + m_Sun: {fileID: 0} +--- !u!157 &3 +LightmapSettings: + m_ObjectHideFlags: 0 + serializedVersion: 6 + m_GIWorkflowMode: 0 + m_LightmapsMode: 1 + m_GISettings: + serializedVersion: 2 + m_BounceScale: 1 + m_IndirectOutputScale: 1 + m_AlbedoBoost: 1 + m_TemporalCoherenceThreshold: 1 + m_EnvironmentLightingMode: 0 + m_EnableBakedLightmaps: 1 + m_EnableRealtimeLightmaps: 1 + m_LightmapEditorSettings: + serializedVersion: 3 + m_Resolution: 2 + m_BakeResolution: 40 + m_TextureWidth: 1024 + m_TextureHeight: 1024 + m_AOMaxDistance: 1 + m_Padding: 2 + m_CompAOExponent: 0 + m_LightmapParameters: {fileID: 0} + m_TextureCompression: 1 + m_FinalGather: 0 + m_FinalGatherRayCount: 1024 + m_ReflectionCompression: 2 + m_LightingDataAsset: {fileID: 0} + m_RuntimeCPUUsage: 25 +--- !u!196 &4 +NavMeshSettings: + serializedVersion: 2 + m_ObjectHideFlags: 0 + m_BuildSettings: + serializedVersion: 2 + agentRadius: 0.5 + agentHeight: 2 + agentSlope: 45 + agentClimb: 0.4 + ledgeDropHeight: 0 + maxJumpAcrossDistance: 0 + accuratePlacement: 0 + minRegionArea: 2 + cellSize: 0.16666667 + manualCellSize: 0 + m_NavMeshData: {fileID: 0} +--- !u!1 &978433746 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 4 + m_Component: + - 4: {fileID: 978433749} + - 114: {fileID: 978433747} + - 114: {fileID: 978433750} + m_Layer: 0 + m_Name: SceneCompositionRoot + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &978433747 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 978433746} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 0e516af87ca41694bbaa70c373f993e0, type: 3} + m_Name: + m_EditorClassIdentifier: + _runAll: 1 + _testMethod: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 978433750} + m_MethodName: Test1 + m_Mode: 1 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 1 + m_TypeName: UnityEngine.Events.UnityEvent, UnityEngine, Version=0.0.0.0, Culture=neutral, + PublicKeyToken=null +--- !u!4 &978433749 +Transform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 978433746} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 +--- !u!114 &978433750 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 978433746} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d7659c77abc45bc4c8e6246b1c584bbf, type: 3} + m_Name: + m_EditorClassIdentifier: + FooPrefab: {fileID: 130070, guid: 54246954ae9afed40ad0e818f0d1702c, type: 2} diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/PrefabFactory/TestPrefabFactory.unity.meta b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/PrefabFactory/TestPrefabFactory.unity.meta new file mode 100644 index 000000000..0aa535ff5 --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/PrefabFactory/TestPrefabFactory.unity.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 72fc368c654821540b1cfba0e9bd3bc3 +timeCreated: 1461165690 +licenseType: Pro +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactory.meta b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactory.meta new file mode 100644 index 000000000..cbe1535bb --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactory.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: d40783ef8557dc74680d885aac004f2b +folderAsset: yes +timeCreated: 1459022918 +licenseType: Pro +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactory/Fixture.cs b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactory/Fixture.cs new file mode 100644 index 000000000..5551d56d1 --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactory/Fixture.cs @@ -0,0 +1,214 @@ +using ModestTree.UnityUnitTester; +using UnityEngine; +using Zenject; + +namespace ModestTree.Tests.Zenject.TestBindFactory +{ + public class Fixture : MonoTestFixture + { + public GameObject FooPrefab; + public GameObject FooSubContainerPrefab; + + [Test] + public void TestToGameObjectSelf() + { + Container.BindFactory().FromGameObject(); + + FixtureUtil.CallFactoryCreateMethod(Container); + + FixtureUtil.AssertComponentCount(Container, 1); + FixtureUtil.AssertNumGameObjects(Container, 1); + } + + [Test] + [ExpectedException] + [ExpectedValidationException] + public void TestToGameObjectSelfFail() + { + Container.BindFactory().FromGameObject(); + + FixtureUtil.CallFactoryCreateMethod(Container); + } + + [Test] + public void TestToGameObjectConcrete() + { + Container.BindFactory().To().FromGameObject(); + + FixtureUtil.CallFactoryCreateMethod(Container); + FixtureUtil.AssertComponentCount(Container, 1); + FixtureUtil.AssertNumGameObjects(Container, 1); + } + + [Test] + public void TestToMonoBehaviourSelf() + { + var gameObject = Container.CreateEmptyGameObject("foo"); + + Container.BindFactory().FromComponent(gameObject); + + FixtureUtil.CallFactoryCreateMethod(Container); + FixtureUtil.AssertComponentCount(Container, 1); + FixtureUtil.AssertNumGameObjects(Container, 1); + } + + [Test] + [ExpectedException] + [ExpectedValidationException] + public void TestToMonoBehaviourSelfFail() + { + Container.BindFactory().FromComponent((GameObject)null); + } + + [Test] + public void TestToMonoBehaviourConcrete() + { + var gameObject = Container.CreateEmptyGameObject("foo"); + + Container.BindFactory().To().FromComponent(gameObject); + + FixtureUtil.CallFactoryCreateMethod(Container); + FixtureUtil.AssertComponentCount(Container, 1); + FixtureUtil.AssertNumGameObjects(Container, 1); + } + + [Test] + public void TestToPrefabSelf() + { + Container.BindFactory().FromPrefab(FooPrefab).WithGameObjectName("asdf"); + + FixtureUtil.CallFactoryCreateMethod(Container); + + FixtureUtil.AssertComponentCount(Container, 1); + FixtureUtil.AssertNumGameObjects(Container, 1); + FixtureUtil.AssertNumGameObjectsWithName(Container, "asdf", 1); + } + + [Test] + [ExpectedException] + [ExpectedValidationException] + public void TestToPrefabSelfFail() + { + // Foo3 is not on the prefab + Container.BindFactory().FromPrefab(FooPrefab); + + FixtureUtil.CallFactoryCreateMethod(Container); + } + + [Test] + public void TestToPrefabConcrete() + { + Container.BindFactory().To().FromPrefab(FooPrefab).WithGameObjectName("asdf"); + + FixtureUtil.CallFactoryCreateMethod(Container); + + FixtureUtil.AssertComponentCount(Container, 1); + FixtureUtil.AssertNumGameObjects(Container, 1); + FixtureUtil.AssertNumGameObjectsWithName(Container, "asdf", 1); + } + + [Test] + public void TestToResourceSelf() + { + Container.BindFactory>() + .FromResource("TestBindFactory/TestTexture"); + Container.BindRootResolve>(); + + FixtureUtil.CallFactoryCreateMethod>(Container); + } + + [Test] + public void TestToResource() + { + Container.BindFactory>() + .To().FromResource("TestBindFactory/TestTexture"); + Container.BindRootResolve>(); + } + + [Test] + public void TestToPrefabResourceSelf() + { + Container.BindFactory().FromPrefabResource("TestBindFactory/Foo").WithGameObjectName("asdf"); + + FixtureUtil.CallFactoryCreateMethod(Container); + + FixtureUtil.AssertComponentCount(Container, 1); + FixtureUtil.AssertNumGameObjects(Container, 1); + FixtureUtil.AssertNumGameObjectsWithName(Container, "asdf", 1); + } + + [Test] + public void TestToPrefabResourceConcrete() + { + Container.BindFactory().To().FromPrefabResource("TestBindFactory/Foo").WithGameObjectName("asdf"); + + FixtureUtil.CallFactoryCreateMethod(Container); + + FixtureUtil.AssertComponentCount(Container, 1); + FixtureUtil.AssertNumGameObjects(Container, 1); + FixtureUtil.AssertNumGameObjectsWithName(Container, "asdf", 1); + } + + [Test] + public void TestToSubContainerPrefabSelf() + { + Container.BindFactory().FromSubContainerResolve().ByPrefab(FooSubContainerPrefab); + + FixtureUtil.CallFactoryCreateMethod(Container); + + FixtureUtil.AssertComponentCount(Container, 1); + FixtureUtil.AssertNumGameObjects(Container, 1); + } + + [Test] + public void TestToSubContainerPrefabConcrete() + { + Container.BindFactory() + .To().FromSubContainerResolve().ByPrefab(FooSubContainerPrefab); + + FixtureUtil.CallFactoryCreateMethod(Container); + FixtureUtil.AssertComponentCount(Container, 1); + FixtureUtil.AssertNumGameObjects(Container, 1); + } + + [Test] + public void TestToSubContainerPrefabResourceSelf() + { + Container.BindFactory() + .FromSubContainerResolve().ByPrefabResource("TestBindFactory/FooSubContainer"); + + FixtureUtil.CallFactoryCreateMethod(Container); + + FixtureUtil.AssertComponentCount(Container, 1); + FixtureUtil.AssertNumGameObjects(Container, 1); + } + + [Test] + public void TestToSubContainerPrefabResourceConcrete() + { + Container.BindFactory() + .To().FromSubContainerResolve().ByPrefabResource("TestBindFactory/FooSubContainer"); + + FixtureUtil.CallFactoryCreateMethod(Container); + FixtureUtil.AssertComponentCount(Container, 1); + FixtureUtil.AssertNumGameObjects(Container, 1); + } + + public class Foo3 : MonoBehaviour + { + public class Factory : Factory + { + } + } + + public class Foo2 : MonoBehaviour + { + [Inject] + int _value; + + public class Factory : Factory + { + } + } + } +} diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactory/Fixture.cs.meta b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactory/Fixture.cs.meta new file mode 100644 index 000000000..6c39a4f0f --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactory/Fixture.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 515d1ac202f66014c980859ae924325a +timeCreated: 1459022928 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactory/Foo.cs b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactory/Foo.cs new file mode 100644 index 000000000..f94a29301 --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactory/Foo.cs @@ -0,0 +1,20 @@ +using UnityEngine; +using Zenject; + +namespace ModestTree.Tests.Zenject.TestBindFactory +{ + public interface IFoo + { + } + + public class IFooFactory : Factory + { + } + + public class Foo : MonoBehaviour, IFoo + { + public class Factory : Factory + { + } + } +} diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactory/Foo.cs.meta b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactory/Foo.cs.meta new file mode 100644 index 000000000..47b74fb30 --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactory/Foo.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: d2d5f4f0d25441b4b8dbdcf3e25815a4 +timeCreated: 1459026782 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactory/Resources.meta b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactory/Resources.meta new file mode 100644 index 000000000..53c16ebd0 --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactory/Resources.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 04096944244ac8d4aa44abb732c12768 +folderAsset: yes +timeCreated: 1459032867 +licenseType: Pro +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactory/Resources/TestBindFactory.meta b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactory/Resources/TestBindFactory.meta new file mode 100644 index 000000000..c38c94b13 --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactory/Resources/TestBindFactory.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 75a30b90ca91dde4aaf6c9044016a358 +folderAsset: yes +timeCreated: 1459032868 +licenseType: Pro +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactory/Resources/TestBindFactory/Foo.prefab b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactory/Resources/TestBindFactory/Foo.prefab new file mode 100644 index 000000000..29dd548a8 --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactory/Resources/TestBindFactory/Foo.prefab @@ -0,0 +1,52 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &162430 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 4: {fileID: 447808} + - 114: {fileID: 11404662} + m_Layer: 0 + m_Name: Foo + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &447808 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 162430} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 +--- !u!114 &11404662 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 162430} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d2d5f4f0d25441b4b8dbdcf3e25815a4, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!1001 &100100000 +Prefab: + m_ObjectHideFlags: 1 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: [] + m_RemovedComponents: [] + m_ParentPrefab: {fileID: 0} + m_RootGameObject: {fileID: 162430} + m_IsPrefabParent: 1 diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactory/Resources/TestBindFactory/Foo.prefab.meta b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactory/Resources/TestBindFactory/Foo.prefab.meta new file mode 100644 index 000000000..6036d8a92 --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactory/Resources/TestBindFactory/Foo.prefab.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 1f6c6b0b26248ff40ab262d17954f3cd +timeCreated: 1459026819 +licenseType: Pro +NativeFormatImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactory/Resources/TestBindFactory/FooSubContainer.prefab b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactory/Resources/TestBindFactory/FooSubContainer.prefab new file mode 100644 index 000000000..ced31b642 --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactory/Resources/TestBindFactory/FooSubContainer.prefab @@ -0,0 +1,113 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &106024 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 4: {fileID: 432184} + - 114: {fileID: 11419678} + - 114: {fileID: 11408080} + m_Layer: 0 + m_Name: Foo + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &162430 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 4: {fileID: 447808} + - 114: {fileID: 11464440} + m_Layer: 0 + m_Name: FooSubContainer + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &432184 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 106024} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 447808} + m_RootOrder: 0 +--- !u!4 &447808 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 162430} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 432184} + m_Father: {fileID: 0} + m_RootOrder: 0 +--- !u!114 &11408080 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 106024} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 0166d8ff8d905b048b2448179e1f5d11, type: 3} + m_Name: + m_EditorClassIdentifier: + _components: + - {fileID: 11419678} + _identifier: + _compositionRoot: {fileID: 0} + _bindType: 0 +--- !u!114 &11419678 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 106024} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d2d5f4f0d25441b4b8dbdcf3e25815a4, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!114 &11464440 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 162430} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 08eca9f7688a0a24685b89133b020c8e, type: 3} + m_Name: + m_EditorClassIdentifier: + _installers: [] + _installerPrefabs: [] + _scriptableObjectInstallers: [] + _facade: {fileID: 0} +--- !u!1001 &100100000 +Prefab: + m_ObjectHideFlags: 1 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: [] + m_RemovedComponents: [] + m_ParentPrefab: {fileID: 0} + m_RootGameObject: {fileID: 162430} + m_IsPrefabParent: 1 diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactory/Resources/TestBindFactory/FooSubContainer.prefab.meta b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactory/Resources/TestBindFactory/FooSubContainer.prefab.meta new file mode 100644 index 000000000..3a4c78c2a --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactory/Resources/TestBindFactory/FooSubContainer.prefab.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 5c4623f8776b50946bec4dd4e9b322e1 +timeCreated: 1460652820 +licenseType: Pro +NativeFormatImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactory/Resources/TestBindFactory/TestTexture.png b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactory/Resources/TestBindFactory/TestTexture.png new file mode 100644 index 0000000000000000000000000000000000000000..ae559b9708c7665a94bf2661a51b7944cc10fb0f GIT binary patch literal 13429 zcmaKTbC4#_w(ZxRwlQsM+ICOdw)wSfbK15w)3$Bfw#{k#_3zw!?tOo}^D3e$5qqt@ zbLWbz%8aNmd08=d7;G2-001u`F0A-f=6>Cs-$1{fy!HukU&VJP5p^deTN5W&0|y{L zz}VIhNGM@#UOKj%k zWXDBM@9OGG=gLfH>tIUH$jQn14+j$y?Ux0uqq~ihfg7!jBgwxRgn^Dm4(4`F=C(G3 z|1cUD+B!S&5`RVdUqi6A`yW~x$Nx^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K#^hszPdLt;^Ka=%YJIZCElMn`}#p0&N%ad#2fe4f{KCzsB)A;$9yr zoX|&j=o`0L%APg(-Yj0vhm+2@7r~73tc3cwqFTkl&*%s_Lq*~+QtG5;Uy*#mkljRm z$<)2D$;wVd3-SnV!b_;2$MV{u_tIaGxe^1)Sw6t|6mi$#E-)c6K(T+kz<#1 zZrml1b%xm&W{+567GmR^-uaG|2hgf2IpK5+&k@#LrYHh+M++clDUM=16B=MEC!Gil zYi1$p*N7qoB|`JPhVbx!n)=D`Oe0bRqVLfpY?z;ZmhCjw&=7c3_f`DA?OoWifEDzTcjA5=|85IwU$+3+j%A-GdZmT zo%SN^9`dAuZ?W~n`yAo+=Y4y19D~xr8-*Z;$9fBu+xyZ>dkvVy1yvl)}CSPo+P=%#AQhs)3mJ1Q}Vi2MG-PN+?Y9KQkpzd z7Pn!v4_1-O7uLNLO{^l>urhx870HOCN1~ZqZU2pM%aF*16tIymzK=z!A*=Ayia>Ng z!ChLmj=moOQyt~JylqTAJ8pQN1D#8fk+J`;Z9i* z`zhAMGS$1KwEW%^S3BhJYBY+*#eQe)p4^oq)TVjuMpeeKxeg_=Uza_Cquu2WvWE$BreghnK1@ z&;(vB}d{|j#&DH}?ZXQd!kLhrdd z%8f>}m@GTTm`O*WU)fz&=469ghH+~dBnkv}$$E%74>Dem;bGkoYuaO4Pio}P;1wwl eq=Qdb2EYaZ>VOt3zREv80!fI-3Rep12mBu&P-{E@ literal 0 HcmV?d00001 diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactory/Resources/TestBindFactory/TestTexture.png.meta b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactory/Resources/TestBindFactory/TestTexture.png.meta new file mode 100644 index 000000000..d5b0c30c3 --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactory/Resources/TestBindFactory/TestTexture.png.meta @@ -0,0 +1,57 @@ +fileFormatVersion: 2 +guid: 7dd391639aa29ed45a73e9a214f4872c +timeCreated: 1459032868 +licenseType: Pro +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + linearTexture: 0 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 7 + cubemapConvolutionExponent: 1.5 + seamlessCubemap: 0 + textureFormat: -1 + maxTextureSize: 2048 + textureSettings: + filterMode: -1 + aniso: -1 + mipBias: -1 + wrapMode: -1 + nPOTScale: 1 + lightmap: 0 + rGBM: 0 + compressionQuality: 50 + allowsAlphaSplitting: 0 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 0 + textureType: -1 + buildTargetSettings: [] + spriteSheet: + sprites: [] + outline: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactory/TestBindFactory.unity b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactory/TestBindFactory.unity new file mode 100644 index 000000000..f65ae94ec --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactory/TestBindFactory.unity @@ -0,0 +1,158 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!29 &1 +SceneSettings: + m_ObjectHideFlags: 0 + m_PVSData: + m_PVSObjectsArray: [] + m_PVSPortalsArray: [] + m_OcclusionBakeSettings: + smallestOccluder: 5 + smallestHole: 0.25 + backfaceThreshold: 100 +--- !u!104 &2 +RenderSettings: + m_ObjectHideFlags: 0 + serializedVersion: 6 + m_Fog: 0 + m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} + m_FogMode: 3 + m_FogDensity: 0.01 + m_LinearFogStart: 0 + m_LinearFogEnd: 300 + m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} + m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} + m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} + m_AmbientIntensity: 1 + m_AmbientMode: 0 + m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0} + m_HaloStrength: 0.5 + m_FlareStrength: 1 + m_FlareFadeSpeed: 3 + m_HaloTexture: {fileID: 0} + m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} + m_DefaultReflectionMode: 0 + m_DefaultReflectionResolution: 128 + m_ReflectionBounces: 1 + m_ReflectionIntensity: 1 + m_CustomReflection: {fileID: 0} + m_Sun: {fileID: 0} +--- !u!157 &3 +LightmapSettings: + m_ObjectHideFlags: 0 + serializedVersion: 6 + m_GIWorkflowMode: 0 + m_LightmapsMode: 1 + m_GISettings: + serializedVersion: 2 + m_BounceScale: 1 + m_IndirectOutputScale: 1 + m_AlbedoBoost: 1 + m_TemporalCoherenceThreshold: 1 + m_EnvironmentLightingMode: 0 + m_EnableBakedLightmaps: 1 + m_EnableRealtimeLightmaps: 1 + m_LightmapEditorSettings: + serializedVersion: 3 + m_Resolution: 2 + m_BakeResolution: 40 + m_TextureWidth: 1024 + m_TextureHeight: 1024 + m_AOMaxDistance: 1 + m_Padding: 2 + m_CompAOExponent: 0 + m_LightmapParameters: {fileID: 0} + m_TextureCompression: 1 + m_FinalGather: 0 + m_FinalGatherRayCount: 1024 + m_ReflectionCompression: 2 + m_LightingDataAsset: {fileID: 0} + m_RuntimeCPUUsage: 25 +--- !u!196 &4 +NavMeshSettings: + serializedVersion: 2 + m_ObjectHideFlags: 0 + m_BuildSettings: + serializedVersion: 2 + agentRadius: 0.5 + agentHeight: 2 + agentSlope: 45 + agentClimb: 0.4 + ledgeDropHeight: 0 + maxJumpAcrossDistance: 0 + accuratePlacement: 0 + minRegionArea: 2 + cellSize: 0.16666667 + manualCellSize: 0 + m_NavMeshData: {fileID: 0} +--- !u!1 &978433746 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 4 + m_Component: + - 4: {fileID: 978433749} + - 114: {fileID: 978433747} + - 114: {fileID: 978433750} + m_Layer: 0 + m_Name: SceneCompositionRoot + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &978433747 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 978433746} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 0e516af87ca41694bbaa70c373f993e0, type: 3} + m_Name: + m_EditorClassIdentifier: + _runAll: 1 + _testMethod: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 978433750} + m_MethodName: TestToSubContainerPrefabResourceConcrete + m_Mode: 1 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 1 + m_TypeName: UnityEngine.Events.UnityEvent, UnityEngine, Version=0.0.0.0, Culture=neutral, + PublicKeyToken=null +--- !u!4 &978433749 +Transform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 978433746} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 +--- !u!114 &978433750 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 978433746} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 515d1ac202f66014c980859ae924325a, type: 3} + m_Name: + m_EditorClassIdentifier: + FooPrefab: {fileID: 162430, guid: 1f6c6b0b26248ff40ab262d17954f3cd, type: 2} + FooSubContainerPrefab: {fileID: 162430, guid: 5c4623f8776b50946bec4dd4e9b322e1, + type: 2} diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactory/TestBindFactory.unity.meta b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactory/TestBindFactory.unity.meta new file mode 100644 index 000000000..da347859b --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactory/TestBindFactory.unity.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 0299b7b8d0140174b98ab76935aa291f +timeCreated: 1459022928 +licenseType: Pro +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactoryFive.meta b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactoryFive.meta new file mode 100644 index 000000000..0a81549d5 --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactoryFive.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 53dcce6da2ccd0840bda6e58ee3b2cc5 +folderAsset: yes +timeCreated: 1460650158 +licenseType: Pro +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactoryFive/Fixture.cs b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactoryFive/Fixture.cs new file mode 100644 index 000000000..85d7b6329 --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactoryFive/Fixture.cs @@ -0,0 +1,185 @@ +using ModestTree.UnityUnitTester; +using UnityEngine; +using Zenject; + +namespace ModestTree.Tests.Zenject.TestBindFactoryFive +{ + public class Fixture : MonoTestFixture + { + public GameObject FooPrefab; + public GameObject FooSubContainerPrefab; + + [Test] + public void TestToGameObjectSelf() + { + Container.BindFactory().FromGameObject(); + + AddFactoryUser(); + + FixtureUtil.AssertComponentCount(Container, 1); + FixtureUtil.AssertNumGameObjects(Container, 1); + } + + [Test] + public void TestToGameObjectConcrete() + { + Container.BindFactory().To().FromGameObject(); + + AddFactoryUser(); + + FixtureUtil.AssertComponentCount(Container, 1); + FixtureUtil.AssertNumGameObjects(Container, 1); + } + + [Test] + public void TestToMonoBehaviourSelf() + { + var gameObject = Container.CreateEmptyGameObject("foo"); + + Container.BindFactory().FromComponent(gameObject); + + AddFactoryUser(); + + FixtureUtil.AssertComponentCount(Container, 1); + FixtureUtil.AssertNumGameObjects(Container, 1); + } + + [Test] + public void TestToMonoBehaviourConcrete() + { + var gameObject = Container.CreateEmptyGameObject("foo"); + + Container.BindFactory().To().FromComponent(gameObject); + + AddFactoryUser(); + + FixtureUtil.AssertComponentCount(Container, 1); + FixtureUtil.AssertNumGameObjects(Container, 1); + } + + [Test] + public void TestToPrefabSelf() + { + Container.BindFactory().FromPrefab(FooPrefab).WithGameObjectName("asdf"); + + AddFactoryUser(); + + FixtureUtil.AssertComponentCount(Container, 1); + FixtureUtil.AssertNumGameObjects(Container, 1); + FixtureUtil.AssertNumGameObjectsWithName(Container, "asdf", 1); + } + + [Test] + public void TestToPrefabConcrete() + { + Container.BindFactory().To().FromPrefab(FooPrefab).WithGameObjectName("asdf"); + + AddFactoryUser(); + + FixtureUtil.AssertComponentCount(Container, 1); + FixtureUtil.AssertNumGameObjects(Container, 1); + FixtureUtil.AssertNumGameObjectsWithName(Container, "asdf", 1); + } + + [Test] + public void TestToPrefabResourceSelf() + { + Container.BindFactory().FromPrefabResource("TestBindFactoryFive/Foo").WithGameObjectName("asdf"); + + AddFactoryUser(); + + FixtureUtil.AssertComponentCount(Container, 1); + FixtureUtil.AssertNumGameObjects(Container, 1); + FixtureUtil.AssertNumGameObjectsWithName(Container, "asdf", 1); + } + + [Test] + public void TestToPrefabResourceConcrete() + { + Container.BindFactory() + .To().FromPrefabResource("TestBindFactoryFive/Foo").WithGameObjectName("asdf"); + + AddFactoryUser(); + + FixtureUtil.AssertComponentCount(Container, 1); + FixtureUtil.AssertNumGameObjects(Container, 1); + FixtureUtil.AssertNumGameObjectsWithName(Container, "asdf", 1); + } + + [Test] + public void TestToSubContainerPrefabSelf() + { + Container.BindFactory() + .FromSubContainerResolve().ByPrefab(FooSubContainerPrefab); + + AddFactoryUser(); + + FixtureUtil.AssertComponentCount(Container, 1); + FixtureUtil.AssertNumGameObjects(Container, 1); + } + + [Test] + public void TestToSubContainerPrefabConcrete() + { + Container.BindFactory() + .To().FromSubContainerResolve().ByPrefab(FooSubContainerPrefab); + + AddFactoryUser(); + + FixtureUtil.AssertComponentCount(Container, 1); + FixtureUtil.AssertNumGameObjects(Container, 1); + } + + [Test] + public void TestToSubContainerPrefabResourceSelf() + { + Container.BindFactory().FromSubContainerResolve().ByPrefabResource("TestBindFactoryFive/FooSubContainer"); + + AddFactoryUser(); + + FixtureUtil.AssertComponentCount(Container, 1); + FixtureUtil.AssertNumGameObjects(Container, 1); + } + + [Test] + public void TestToSubContainerPrefabResourceConcrete() + { + Container.BindFactory() + .To().FromSubContainerResolve().ByPrefabResource("TestBindFactoryFive/FooSubContainer"); + + AddFactoryUser(); + + FixtureUtil.AssertComponentCount(Container, 1); + FixtureUtil.AssertNumGameObjects(Container, 1); + } + + void AddFactoryUser() + where TValue : IFoo + where TFactory : Factory + { + Container.Bind() + .To>().AsSingle(); + + Container.BindExecutionOrder>(-100); + } + + public class FooFactoryTester : IInitializable + where TFactory : Factory + where TValue : IFoo + { + readonly TFactory _factory; + + public FooFactoryTester(TFactory factory) + { + _factory = factory; + } + + public void Initialize() + { + Assert.IsEqual(_factory.Create(0.15, 0, 2.4f, "zxcv", 'z').Value, "zxcv"); + + Log.Info("Factory created foo successfully"); + } + } + } +} diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactoryFive/Fixture.cs.meta b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactoryFive/Fixture.cs.meta new file mode 100644 index 000000000..774eafb25 --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactoryFive/Fixture.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: efc41e300d22c004785a433c1660c3d2 +timeCreated: 1460650180 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactoryFive/Foo.cs b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactoryFive/Foo.cs new file mode 100644 index 000000000..fb486ec9d --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactoryFive/Foo.cs @@ -0,0 +1,36 @@ +using UnityEngine; +using Zenject; + +namespace ModestTree.Tests.Zenject.TestBindFactoryFive +{ + public interface IFoo + { + string Value + { + get; + } + } + + public class IFooFactory : Factory + { + } + + public class Foo : MonoBehaviour, IFoo + { + [PostInject] + public void Init(double p1, int p2, float p3, string p4, char p5) + { + Value = p4; + } + + public string Value + { + get; + private set; + } + + public class Factory : Factory + { + } + } +} diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactoryFive/Foo.cs.meta b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactoryFive/Foo.cs.meta new file mode 100644 index 000000000..61897db82 --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactoryFive/Foo.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: ee5b82f7221fdcb499856642f6436061 +timeCreated: 1460650180 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactoryFive/FooInstaller.cs b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactoryFive/FooInstaller.cs new file mode 100644 index 000000000..8af526c96 --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactoryFive/FooInstaller.cs @@ -0,0 +1,35 @@ +using System; +using Zenject; + +namespace ModestTree.Tests.Zenject.TestBindFactoryFive +{ + public class FooInstaller : MonoInstaller + { + double _param1; + int _param2; + float _param3; + string _param4; + char _param5; + + [PostInject] + public void Init(double p1, int p2, float p3, string p4, char p5) + { + _param1 = p1; + _param2 = p2; + _param3 = p3; + _param4 = p4; + _param5 = p5; + } + + public override void InstallBindings() + { + Container.BindInstance(_param1).WhenInjectedInto(); + Container.BindInstance(_param2).WhenInjectedInto(); + Container.BindInstance(_param3).WhenInjectedInto(); + Container.BindInstance(_param4).WhenInjectedInto(); + Container.BindInstance(_param5).WhenInjectedInto(); + + Container.Bind().FromGameObject(); + } + } +} diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactoryFive/FooInstaller.cs.meta b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactoryFive/FooInstaller.cs.meta new file mode 100644 index 000000000..c37f10e00 --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactoryFive/FooInstaller.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 90704beb7bb03b548a09a57bf84fd76a +timeCreated: 1460650180 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactoryFive/Resources.meta b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactoryFive/Resources.meta new file mode 100644 index 000000000..514b1a4f4 --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactoryFive/Resources.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 560835f4e49bbc24a919a5ac5e9dfd78 +folderAsset: yes +timeCreated: 1460650279 +licenseType: Pro +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactoryFive/Resources/TestBindFactoryFive.meta b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactoryFive/Resources/TestBindFactoryFive.meta new file mode 100644 index 000000000..434fe834a --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactoryFive/Resources/TestBindFactoryFive.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: cdc9bfa93df160f44a355be60a33e404 +folderAsset: yes +timeCreated: 1460650286 +licenseType: Pro +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactoryFive/Resources/TestBindFactoryFive/Foo.prefab b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactoryFive/Resources/TestBindFactoryFive/Foo.prefab new file mode 100644 index 000000000..9c4c199de --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactoryFive/Resources/TestBindFactoryFive/Foo.prefab @@ -0,0 +1,52 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &115482 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 4: {fileID: 444256} + - 114: {fileID: 11480358} + m_Layer: 0 + m_Name: Foo + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &444256 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 115482} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: -37.141693, y: 4.1177154, z: 8.340115} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 +--- !u!114 &11480358 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 115482} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: ee5b82f7221fdcb499856642f6436061, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!1001 &100100000 +Prefab: + m_ObjectHideFlags: 1 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: [] + m_RemovedComponents: [] + m_ParentPrefab: {fileID: 0} + m_RootGameObject: {fileID: 115482} + m_IsPrefabParent: 1 diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactoryFive/Resources/TestBindFactoryFive/Foo.prefab.meta b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactoryFive/Resources/TestBindFactoryFive/Foo.prefab.meta new file mode 100644 index 000000000..56608c026 --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactoryFive/Resources/TestBindFactoryFive/Foo.prefab.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 5c07ac3e518881e48885b91850c2f13c +timeCreated: 1460650304 +licenseType: Pro +NativeFormatImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactoryFive/Resources/TestBindFactoryFive/FooSubContainer.prefab b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactoryFive/Resources/TestBindFactoryFive/FooSubContainer.prefab new file mode 100644 index 000000000..c0a54afcc --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactoryFive/Resources/TestBindFactoryFive/FooSubContainer.prefab @@ -0,0 +1,69 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &136558 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 4: {fileID: 434280} + - 114: {fileID: 11447176} + - 114: {fileID: 11491928} + m_Layer: 0 + m_Name: FooSubContainer + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &434280 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 136558} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: -37.141693, y: 4.1177154, z: 8.340115} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 +--- !u!114 &11447176 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 136558} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 08eca9f7688a0a24685b89133b020c8e, type: 3} + m_Name: + m_EditorClassIdentifier: + _installers: + - {fileID: 11491928} + _installerPrefabs: [] + _scriptableObjectInstallers: [] + _facade: {fileID: 0} +--- !u!114 &11491928 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 136558} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 90704beb7bb03b548a09a57bf84fd76a, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!1001 &100100000 +Prefab: + m_ObjectHideFlags: 1 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: [] + m_RemovedComponents: [] + m_ParentPrefab: {fileID: 0} + m_RootGameObject: {fileID: 136558} + m_IsPrefabParent: 1 diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactoryFive/Resources/TestBindFactoryFive/FooSubContainer.prefab.meta b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactoryFive/Resources/TestBindFactoryFive/FooSubContainer.prefab.meta new file mode 100644 index 000000000..571f8d10b --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactoryFive/Resources/TestBindFactoryFive/FooSubContainer.prefab.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: ecdaaf4205a5c4046ae08fbe25f94e42 +timeCreated: 1460650324 +licenseType: Pro +NativeFormatImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactoryFive/TestBindFactoryFive.unity b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactoryFive/TestBindFactoryFive.unity new file mode 100644 index 000000000..6a65729fd --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactoryFive/TestBindFactoryFive.unity @@ -0,0 +1,158 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!29 &1 +SceneSettings: + m_ObjectHideFlags: 0 + m_PVSData: + m_PVSObjectsArray: [] + m_PVSPortalsArray: [] + m_OcclusionBakeSettings: + smallestOccluder: 5 + smallestHole: 0.25 + backfaceThreshold: 100 +--- !u!104 &2 +RenderSettings: + m_ObjectHideFlags: 0 + serializedVersion: 6 + m_Fog: 0 + m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} + m_FogMode: 3 + m_FogDensity: 0.01 + m_LinearFogStart: 0 + m_LinearFogEnd: 300 + m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} + m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} + m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} + m_AmbientIntensity: 1 + m_AmbientMode: 0 + m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0} + m_HaloStrength: 0.5 + m_FlareStrength: 1 + m_FlareFadeSpeed: 3 + m_HaloTexture: {fileID: 0} + m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} + m_DefaultReflectionMode: 0 + m_DefaultReflectionResolution: 128 + m_ReflectionBounces: 1 + m_ReflectionIntensity: 1 + m_CustomReflection: {fileID: 0} + m_Sun: {fileID: 0} +--- !u!157 &3 +LightmapSettings: + m_ObjectHideFlags: 0 + serializedVersion: 6 + m_GIWorkflowMode: 0 + m_LightmapsMode: 1 + m_GISettings: + serializedVersion: 2 + m_BounceScale: 1 + m_IndirectOutputScale: 1 + m_AlbedoBoost: 1 + m_TemporalCoherenceThreshold: 1 + m_EnvironmentLightingMode: 0 + m_EnableBakedLightmaps: 1 + m_EnableRealtimeLightmaps: 1 + m_LightmapEditorSettings: + serializedVersion: 3 + m_Resolution: 2 + m_BakeResolution: 40 + m_TextureWidth: 1024 + m_TextureHeight: 1024 + m_AOMaxDistance: 1 + m_Padding: 2 + m_CompAOExponent: 0 + m_LightmapParameters: {fileID: 0} + m_TextureCompression: 1 + m_FinalGather: 0 + m_FinalGatherRayCount: 1024 + m_ReflectionCompression: 2 + m_LightingDataAsset: {fileID: 0} + m_RuntimeCPUUsage: 25 +--- !u!196 &4 +NavMeshSettings: + serializedVersion: 2 + m_ObjectHideFlags: 0 + m_BuildSettings: + serializedVersion: 2 + agentRadius: 0.5 + agentHeight: 2 + agentSlope: 45 + agentClimb: 0.4 + ledgeDropHeight: 0 + maxJumpAcrossDistance: 0 + accuratePlacement: 0 + minRegionArea: 2 + cellSize: 0.16666667 + manualCellSize: 0 + m_NavMeshData: {fileID: 0} +--- !u!1 &978433746 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 4 + m_Component: + - 4: {fileID: 978433749} + - 114: {fileID: 978433747} + - 114: {fileID: 978433750} + m_Layer: 0 + m_Name: SceneCompositionRoot + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &978433747 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 978433746} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 0e516af87ca41694bbaa70c373f993e0, type: 3} + m_Name: + m_EditorClassIdentifier: + _runAll: 1 + _testMethod: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 978433750} + m_MethodName: TestToSubContainerPrefabSelf + m_Mode: 1 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 1 + m_TypeName: UnityEngine.Events.UnityEvent, UnityEngine, Version=0.0.0.0, Culture=neutral, + PublicKeyToken=null +--- !u!4 &978433749 +Transform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 978433746} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 +--- !u!114 &978433750 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 978433746} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: efc41e300d22c004785a433c1660c3d2, type: 3} + m_Name: + m_EditorClassIdentifier: + FooPrefab: {fileID: 115482, guid: 5c07ac3e518881e48885b91850c2f13c, type: 2} + FooSubContainerPrefab: {fileID: 136558, guid: ecdaaf4205a5c4046ae08fbe25f94e42, + type: 2} diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactoryFive/TestBindFactoryFive.unity.meta b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactoryFive/TestBindFactoryFive.unity.meta new file mode 100644 index 000000000..f9c7a5715 --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactoryFive/TestBindFactoryFive.unity.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 0092bba31a1115748bcfc96a90d03c46 +timeCreated: 1460650180 +licenseType: Pro +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactoryOne.meta b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactoryOne.meta new file mode 100644 index 000000000..cb49f7e75 --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactoryOne.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 8dc97d13c0b4690458f0e3400cc375b9 +folderAsset: yes +timeCreated: 1459036969 +licenseType: Pro +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactoryOne/Fixture.cs b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactoryOne/Fixture.cs new file mode 100644 index 000000000..0b402db4c --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactoryOne/Fixture.cs @@ -0,0 +1,184 @@ +using ModestTree.UnityUnitTester; +using UnityEngine; +using Zenject; + +namespace ModestTree.Tests.Zenject.TestBindFactoryOne +{ + public class Fixture : MonoTestFixture + { + public GameObject FooPrefab; + public GameObject FooSubContainerPrefab; + + [Test] + public void TestToGameObjectSelf() + { + Container.BindFactory().FromGameObject(); + + AddFactoryUser(); + + FixtureUtil.AssertComponentCount(Container, 1); + FixtureUtil.AssertNumGameObjects(Container, 1); + } + + [Test] + public void TestToGameObjectConcrete() + { + Container.BindFactory().To().FromGameObject(); + + AddFactoryUser(); + + FixtureUtil.AssertComponentCount(Container, 1); + FixtureUtil.AssertNumGameObjects(Container, 1); + } + + [Test] + public void TestToMonoBehaviourSelf() + { + var gameObject = Container.CreateEmptyGameObject("foo"); + + Container.BindFactory().FromComponent(gameObject); + + AddFactoryUser(); + + FixtureUtil.AssertComponentCount(Container, 1); + FixtureUtil.AssertNumGameObjects(Container, 1); + } + + [Test] + public void TestToMonoBehaviourConcrete() + { + var gameObject = Container.CreateEmptyGameObject("foo"); + + Container.BindFactory().To().FromComponent(gameObject); + + AddFactoryUser(); + + FixtureUtil.AssertComponentCount(Container, 1); + FixtureUtil.AssertNumGameObjects(Container, 1); + } + + [Test] + public void TestToPrefabSelf() + { + Container.BindFactory().FromPrefab(FooPrefab).WithGameObjectName("asdf"); + + AddFactoryUser(); + + FixtureUtil.AssertComponentCount(Container, 1); + FixtureUtil.AssertNumGameObjects(Container, 1); + FixtureUtil.AssertNumGameObjectsWithName(Container, "asdf", 1); + } + + [Test] + public void TestToPrefabConcrete() + { + Container.BindFactory().To().FromPrefab(FooPrefab).WithGameObjectName("asdf"); + + AddFactoryUser(); + + FixtureUtil.AssertComponentCount(Container, 1); + FixtureUtil.AssertNumGameObjects(Container, 1); + FixtureUtil.AssertNumGameObjectsWithName(Container, "asdf", 1); + } + + [Test] + public void TestToPrefabResourceSelf() + { + Container.BindFactory().FromPrefabResource("TestBindFactoryOne/Foo").WithGameObjectName("asdf"); + + AddFactoryUser(); + + FixtureUtil.AssertComponentCount(Container, 1); + FixtureUtil.AssertNumGameObjects(Container, 1); + FixtureUtil.AssertNumGameObjectsWithName(Container, "asdf", 1); + } + + [Test] + public void TestToPrefabResourceConcrete() + { + Container.BindFactory().To().FromPrefabResource("TestBindFactoryOne/Foo").WithGameObjectName("asdf"); + + AddFactoryUser(); + + FixtureUtil.AssertComponentCount(Container, 1); + FixtureUtil.AssertNumGameObjects(Container, 1); + FixtureUtil.AssertNumGameObjectsWithName(Container, "asdf", 1); + } + + [Test] + public void TestToSubContainerPrefabSelf() + { + Container.BindFactory().FromSubContainerResolve().ByPrefab(FooSubContainerPrefab); + + AddFactoryUser(); + + FixtureUtil.AssertComponentCount(Container, 1); + FixtureUtil.AssertNumGameObjects(Container, 1); + } + + [Test] + public void TestToSubContainerPrefabConcrete() + { + Container.BindFactory() + .To().FromSubContainerResolve().ByPrefab(FooSubContainerPrefab); + + AddFactoryUser(); + + FixtureUtil.AssertComponentCount(Container, 1); + FixtureUtil.AssertNumGameObjects(Container, 1); + } + + [Test] + public void TestToSubContainerPrefabResourceSelf() + { + Container.BindFactory() + .FromSubContainerResolve().ByPrefabResource("TestBindFactoryOne/FooSubContainer"); + + AddFactoryUser(); + + FixtureUtil.AssertComponentCount(Container, 1); + FixtureUtil.AssertNumGameObjects(Container, 1); + } + + [Test] + public void TestToSubContainerPrefabResourceConcrete() + { + Container.BindFactory() + .To().FromSubContainerResolve().ByPrefabResource("TestBindFactoryOne/FooSubContainer"); + + AddFactoryUser(); + + FixtureUtil.AssertComponentCount(Container, 1); + FixtureUtil.AssertNumGameObjects(Container, 1); + } + + void AddFactoryUser() + where TValue : IFoo + where TFactory : Factory + { + Container.Bind() + .To>().AsSingle(); + + Container.BindExecutionOrder>(-100); + } + + public class FooFactoryTester : IInitializable + where TFactory : Factory + where TValue : IFoo + { + readonly TFactory _factory; + + public FooFactoryTester(TFactory factory) + { + _factory = factory; + } + + public void Initialize() + { + Assert.IsEqual(_factory.Create("asdf").Value, "asdf"); + + Log.Info("Factory created foo successfully"); + } + } + } +} diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactoryOne/Fixture.cs.meta b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactoryOne/Fixture.cs.meta new file mode 100644 index 000000000..ae95dee65 --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactoryOne/Fixture.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 023811ddaa503dc4c8431d3cd3b69b6d +timeCreated: 1459036978 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactoryOne/Foo.cs b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactoryOne/Foo.cs new file mode 100644 index 000000000..c161faf9b --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactoryOne/Foo.cs @@ -0,0 +1,36 @@ +using UnityEngine; +using Zenject; + +namespace ModestTree.Tests.Zenject.TestBindFactoryOne +{ + public interface IFoo + { + string Value + { + get; + } + } + + public class IFooFactory : Factory + { + } + + public class Foo : MonoBehaviour, IFoo + { + [PostInject] + public void Init(string value) + { + Value = value; + } + + public string Value + { + get; + private set; + } + + public class Factory : Factory + { + } + } +} diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactoryOne/Foo.cs.meta b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactoryOne/Foo.cs.meta new file mode 100644 index 000000000..881ce71e5 --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactoryOne/Foo.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 01d5660ddd4f5d440a15f6ae003cd42a +timeCreated: 1459036978 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactoryOne/FooInstaller.cs b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactoryOne/FooInstaller.cs new file mode 100644 index 000000000..ecb2c1930 --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactoryOne/FooInstaller.cs @@ -0,0 +1,22 @@ +using System; +using Zenject; + +namespace ModestTree.Tests.Zenject.TestBindFactoryOne +{ + public class FooInstaller : MonoInstaller + { + string _param1; + + [PostInject] + public void Init(string param1) + { + _param1 = param1; + } + + public override void InstallBindings() + { + Container.BindInstance(_param1).WhenInjectedInto(); + Container.Bind().FromGameObject(); + } + } +} diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactoryOne/FooInstaller.cs.meta b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactoryOne/FooInstaller.cs.meta new file mode 100644 index 000000000..ff1bb1d0f --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactoryOne/FooInstaller.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: a4c5304e14d4ebf40a4d40c6c382964d +timeCreated: 1460646778 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactoryOne/Resources.meta b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactoryOne/Resources.meta new file mode 100644 index 000000000..1340f8854 --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactoryOne/Resources.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: fd54504068a2202498bcddcef5a1f406 +folderAsset: yes +timeCreated: 1459191999 +licenseType: Pro +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactoryOne/Resources/TestBindFactoryOne.meta b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactoryOne/Resources/TestBindFactoryOne.meta new file mode 100644 index 000000000..5009ca70e --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactoryOne/Resources/TestBindFactoryOne.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: c3643fae8226ddd46a724c9ed954a2fe +folderAsset: yes +timeCreated: 1459192013 +licenseType: Pro +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactoryOne/Resources/TestBindFactoryOne/Foo.prefab b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactoryOne/Resources/TestBindFactoryOne/Foo.prefab new file mode 100644 index 000000000..a2623bece --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactoryOne/Resources/TestBindFactoryOne/Foo.prefab @@ -0,0 +1,52 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &149814 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 4: {fileID: 416932} + - 114: {fileID: 11419076} + m_Layer: 0 + m_Name: Foo + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &416932 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 149814} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 +--- !u!114 &11419076 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 149814} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 01d5660ddd4f5d440a15f6ae003cd42a, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!1001 &100100000 +Prefab: + m_ObjectHideFlags: 1 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: [] + m_RemovedComponents: [] + m_ParentPrefab: {fileID: 0} + m_RootGameObject: {fileID: 149814} + m_IsPrefabParent: 1 diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactoryOne/Resources/TestBindFactoryOne/Foo.prefab.meta b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactoryOne/Resources/TestBindFactoryOne/Foo.prefab.meta new file mode 100644 index 000000000..1280e469f --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactoryOne/Resources/TestBindFactoryOne/Foo.prefab.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 95afbeacc839e0a4da5a6e116f07052e +timeCreated: 1459037082 +licenseType: Pro +NativeFormatImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactoryOne/Resources/TestBindFactoryOne/FooSubContainer.prefab b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactoryOne/Resources/TestBindFactoryOne/FooSubContainer.prefab new file mode 100644 index 000000000..2776801dd --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactoryOne/Resources/TestBindFactoryOne/FooSubContainer.prefab @@ -0,0 +1,69 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &149814 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 4: {fileID: 416932} + - 114: {fileID: 11494492} + - 114: {fileID: 11487118} + m_Layer: 0 + m_Name: FooSubContainer + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &416932 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 149814} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 +--- !u!114 &11487118 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 149814} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: a4c5304e14d4ebf40a4d40c6c382964d, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!114 &11494492 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 149814} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 08eca9f7688a0a24685b89133b020c8e, type: 3} + m_Name: + m_EditorClassIdentifier: + _installers: + - {fileID: 11487118} + _installerPrefabs: [] + _scriptableObjectInstallers: [] + _facade: {fileID: 0} +--- !u!1001 &100100000 +Prefab: + m_ObjectHideFlags: 1 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: [] + m_RemovedComponents: [] + m_ParentPrefab: {fileID: 0} + m_RootGameObject: {fileID: 149814} + m_IsPrefabParent: 1 diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactoryOne/Resources/TestBindFactoryOne/FooSubContainer.prefab.meta b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactoryOne/Resources/TestBindFactoryOne/FooSubContainer.prefab.meta new file mode 100644 index 000000000..ec8503622 --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactoryOne/Resources/TestBindFactoryOne/FooSubContainer.prefab.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 0465df6236950a740af6ead536450d8e +timeCreated: 1460646788 +licenseType: Pro +NativeFormatImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactoryOne/TestBindFactoryOne.unity b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactoryOne/TestBindFactoryOne.unity new file mode 100644 index 000000000..938235e5b --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactoryOne/TestBindFactoryOne.unity @@ -0,0 +1,158 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!29 &1 +SceneSettings: + m_ObjectHideFlags: 0 + m_PVSData: + m_PVSObjectsArray: [] + m_PVSPortalsArray: [] + m_OcclusionBakeSettings: + smallestOccluder: 5 + smallestHole: 0.25 + backfaceThreshold: 100 +--- !u!104 &2 +RenderSettings: + m_ObjectHideFlags: 0 + serializedVersion: 6 + m_Fog: 0 + m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} + m_FogMode: 3 + m_FogDensity: 0.01 + m_LinearFogStart: 0 + m_LinearFogEnd: 300 + m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} + m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} + m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} + m_AmbientIntensity: 1 + m_AmbientMode: 0 + m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0} + m_HaloStrength: 0.5 + m_FlareStrength: 1 + m_FlareFadeSpeed: 3 + m_HaloTexture: {fileID: 0} + m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} + m_DefaultReflectionMode: 0 + m_DefaultReflectionResolution: 128 + m_ReflectionBounces: 1 + m_ReflectionIntensity: 1 + m_CustomReflection: {fileID: 0} + m_Sun: {fileID: 0} +--- !u!157 &3 +LightmapSettings: + m_ObjectHideFlags: 0 + serializedVersion: 6 + m_GIWorkflowMode: 0 + m_LightmapsMode: 1 + m_GISettings: + serializedVersion: 2 + m_BounceScale: 1 + m_IndirectOutputScale: 1 + m_AlbedoBoost: 1 + m_TemporalCoherenceThreshold: 1 + m_EnvironmentLightingMode: 0 + m_EnableBakedLightmaps: 1 + m_EnableRealtimeLightmaps: 1 + m_LightmapEditorSettings: + serializedVersion: 3 + m_Resolution: 2 + m_BakeResolution: 40 + m_TextureWidth: 1024 + m_TextureHeight: 1024 + m_AOMaxDistance: 1 + m_Padding: 2 + m_CompAOExponent: 0 + m_LightmapParameters: {fileID: 0} + m_TextureCompression: 1 + m_FinalGather: 0 + m_FinalGatherRayCount: 1024 + m_ReflectionCompression: 2 + m_LightingDataAsset: {fileID: 0} + m_RuntimeCPUUsage: 25 +--- !u!196 &4 +NavMeshSettings: + serializedVersion: 2 + m_ObjectHideFlags: 0 + m_BuildSettings: + serializedVersion: 2 + agentRadius: 0.5 + agentHeight: 2 + agentSlope: 45 + agentClimb: 0.4 + ledgeDropHeight: 0 + maxJumpAcrossDistance: 0 + accuratePlacement: 0 + minRegionArea: 2 + cellSize: 0.16666667 + manualCellSize: 0 + m_NavMeshData: {fileID: 0} +--- !u!1 &978433746 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 4 + m_Component: + - 4: {fileID: 978433749} + - 114: {fileID: 978433747} + - 114: {fileID: 978433750} + m_Layer: 0 + m_Name: SceneCompositionRoot + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &978433747 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 978433746} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 0e516af87ca41694bbaa70c373f993e0, type: 3} + m_Name: + m_EditorClassIdentifier: + _runAll: 1 + _testMethod: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 978433750} + m_MethodName: TestToSubContainerPrefabConcrete + m_Mode: 1 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 1 + m_TypeName: UnityEngine.Events.UnityEvent, UnityEngine, Version=0.0.0.0, Culture=neutral, + PublicKeyToken=null +--- !u!4 &978433749 +Transform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 978433746} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 +--- !u!114 &978433750 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 978433746} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 023811ddaa503dc4c8431d3cd3b69b6d, type: 3} + m_Name: + m_EditorClassIdentifier: + FooPrefab: {fileID: 149814, guid: 95afbeacc839e0a4da5a6e116f07052e, type: 2} + FooSubContainerPrefab: {fileID: 149814, guid: 0465df6236950a740af6ead536450d8e, + type: 2} diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactoryOne/TestBindFactoryOne.unity.meta b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactoryOne/TestBindFactoryOne.unity.meta new file mode 100644 index 000000000..c4bdcb831 --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestBindFactoryOne/TestBindFactoryOne.unity.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 2b525506a73e0064c8cf1663f636d916 +timeCreated: 1459036978 +licenseType: Pro +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestGameObjectFactory.meta b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestGameObjectFactory.meta new file mode 100644 index 000000000..a5206ff55 --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestGameObjectFactory.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 6c17648f7277132438673d4d8d4ba7fc +folderAsset: yes +timeCreated: 1459098627 +licenseType: Pro +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestGameObjectFactory/OneParam.meta b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestGameObjectFactory/OneParam.meta new file mode 100644 index 000000000..2bcd72e65 --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestGameObjectFactory/OneParam.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: bfc0188eb3622674085014459289c2df +folderAsset: yes +timeCreated: 1459099456 +licenseType: Pro +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestGameObjectFactory/OneParam/Fixture.cs b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestGameObjectFactory/OneParam/Fixture.cs new file mode 100644 index 000000000..38b190bca --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestGameObjectFactory/OneParam/Fixture.cs @@ -0,0 +1,111 @@ +using ModestTree.UnityUnitTester; +using UnityEngine; +using Zenject; + +namespace ModestTree.Tests.Zenject.TestGameObjectFactory.OneParams +{ + public class Fixture : MonoTestFixture + { + public GameObject CubePrefab; + + const string GameObjName = "TestObj"; + + [Test] + public void TestPrefabSelfSingle1() + { + Container.BindFactory().FromPrefab(CubePrefab).WithGameObjectName(GameObjName); + + AddFactoryUser(); + + FixtureUtil.AssertNumGameObjects(Container, 1); + FixtureUtil.AssertNumGameObjectsWithName(Container, GameObjName, 1); + } + + [Test] + public void TestPrefabConcreteSingle1() + { + Container.BindFactory().To().FromPrefab(CubePrefab).WithGameObjectName(GameObjName); + + AddFactoryUser(); + + FixtureUtil.AssertNumGameObjects(Container, 1); + FixtureUtil.AssertNumGameObjectsWithName(Container, GameObjName, 1); + } + + [Test] + public void TestPrefabResourceSelfSingle1() + { + Container.BindFactory().FromPrefabResource("TestGameObjectFactoryOne/Cube").WithGameObjectName(GameObjName); + + AddFactoryUser(); + + FixtureUtil.AssertNumGameObjects(Container, 1); + FixtureUtil.AssertNumGameObjectsWithName(Container, GameObjName, 1); + } + + [Test] + public void TestPrefabResourceConcreteSingle1() + { + Container.BindFactory().To().FromPrefabResource("TestGameObjectFactoryOne/Cube").WithGameObjectName(GameObjName); + + AddFactoryUser(); + + FixtureUtil.AssertNumGameObjects(Container, 1); + FixtureUtil.AssertNumGameObjectsWithName(Container, GameObjName, 1); + } + + void AddFactoryUser() + where T : IInitializable + { + Container.Bind().To().AsSingle(); + Container.BindExecutionOrder(-100); + } + + public class ObjectFactoryTester : IInitializable + { + readonly ObjectFactory _objectFactory; + + public ObjectFactoryTester(ObjectFactory objectFactory) + { + _objectFactory = objectFactory; + } + + public void Initialize() + { + var gameObject = (GameObject)_objectFactory.Create("asdf"); + + Assert.IsEqual(gameObject.GetComponentInChildren().Value, "asdf"); + + Log.Info("ObjectFactory initialized foo successfully"); + } + } + + public class CubeFactoryTester : IInitializable + { + readonly CubeFactory _cubeFactory; + + public CubeFactoryTester(CubeFactory cubeFactory) + { + _cubeFactory = cubeFactory; + } + + public void Initialize() + { + var gameObject = _cubeFactory.Create("asdf"); + + Assert.IsEqual(gameObject.GetComponentInChildren().Value, "asdf"); + + Log.Info("CubeFactory initialized foo successfully"); + } + } + + public class ObjectFactory : Factory + { + } + + public class CubeFactory : Factory + { + } + } +} + diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestGameObjectFactory/OneParam/Fixture.cs.meta b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestGameObjectFactory/OneParam/Fixture.cs.meta new file mode 100644 index 000000000..61cefa84f --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestGameObjectFactory/OneParam/Fixture.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: bcae9322877b14040a778629094879c6 +timeCreated: 1459214356 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestGameObjectFactory/OneParam/Foo.cs b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestGameObjectFactory/OneParam/Foo.cs new file mode 100644 index 000000000..41985048b --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestGameObjectFactory/OneParam/Foo.cs @@ -0,0 +1,20 @@ +using UnityEngine; +using Zenject; + +namespace ModestTree.Tests.Zenject.TestGameObjectFactory.OneParams +{ + public class Foo : MonoBehaviour + { + [PostInject] + public void Init(string value) + { + Value = value; + } + + public string Value + { + get; + private set; + } + } +} diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestGameObjectFactory/OneParam/Foo.cs.meta b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestGameObjectFactory/OneParam/Foo.cs.meta new file mode 100644 index 000000000..5e06909e5 --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestGameObjectFactory/OneParam/Foo.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 5424aef515984fd4da14e474c7ab463c +timeCreated: 1459214388 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestGameObjectFactory/OneParam/Resources.meta b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestGameObjectFactory/OneParam/Resources.meta new file mode 100644 index 000000000..c1712627b --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestGameObjectFactory/OneParam/Resources.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 90633a898ea7b394b8404077f165b482 +folderAsset: yes +timeCreated: 1459214356 +licenseType: Pro +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestGameObjectFactory/OneParam/Resources/TestGameObjectFactoryOne.meta b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestGameObjectFactory/OneParam/Resources/TestGameObjectFactoryOne.meta new file mode 100644 index 000000000..75c3caa3d --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestGameObjectFactory/OneParam/Resources/TestGameObjectFactoryOne.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 058e96bc79a94844d8207b5a9c078dcc +folderAsset: yes +timeCreated: 1459214356 +licenseType: Pro +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestGameObjectFactory/OneParam/Resources/TestGameObjectFactoryOne/Cube.prefab b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestGameObjectFactory/OneParam/Resources/TestGameObjectFactoryOne/Cube.prefab new file mode 100644 index 000000000..a54ee9db3 --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestGameObjectFactory/OneParam/Resources/TestGameObjectFactoryOne/Cube.prefab @@ -0,0 +1,100 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &177174 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 4: {fileID: 452862} + - 33: {fileID: 3315238} + - 65: {fileID: 6519334} + - 23: {fileID: 2390420} + - 114: {fileID: 11443106} + m_Layer: 0 + m_Name: Cube + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &452862 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 177174} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 +--- !u!23 &2390420 +MeshRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 177174} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_Materials: + - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + m_SubsetIndices: + m_StaticBatchRoot: {fileID: 0} + m_UseLightProbes: 1 + m_ReflectionProbeUsage: 1 + m_ProbeAnchor: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 1 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingOrder: 0 +--- !u!33 &3315238 +MeshFilter: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 177174} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!65 &6519334 +BoxCollider: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 177174} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Size: {x: 1, y: 1, z: 1} + m_Center: {x: 0, y: 0, z: 0} +--- !u!114 &11443106 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 177174} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5424aef515984fd4da14e474c7ab463c, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!1001 &100100000 +Prefab: + m_ObjectHideFlags: 1 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: [] + m_RemovedComponents: [] + m_ParentPrefab: {fileID: 0} + m_RootGameObject: {fileID: 177174} + m_IsPrefabParent: 1 diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestGameObjectFactory/OneParam/Resources/TestGameObjectFactoryOne/Cube.prefab.meta b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestGameObjectFactory/OneParam/Resources/TestGameObjectFactoryOne/Cube.prefab.meta new file mode 100644 index 000000000..4c5937842 --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestGameObjectFactory/OneParam/Resources/TestGameObjectFactoryOne/Cube.prefab.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 3aca5d856f350b24eb622adb19746ebc +timeCreated: 1459214356 +licenseType: Pro +NativeFormatImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestGameObjectFactory/OneParam/TestGameObjectFactoryOneParams.unity b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestGameObjectFactory/OneParam/TestGameObjectFactoryOneParams.unity new file mode 100644 index 000000000..02137a462 --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestGameObjectFactory/OneParam/TestGameObjectFactoryOneParams.unity @@ -0,0 +1,156 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!29 &1 +SceneSettings: + m_ObjectHideFlags: 0 + m_PVSData: + m_PVSObjectsArray: [] + m_PVSPortalsArray: [] + m_OcclusionBakeSettings: + smallestOccluder: 5 + smallestHole: 0.25 + backfaceThreshold: 100 +--- !u!104 &2 +RenderSettings: + m_ObjectHideFlags: 0 + serializedVersion: 6 + m_Fog: 0 + m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} + m_FogMode: 3 + m_FogDensity: 0.01 + m_LinearFogStart: 0 + m_LinearFogEnd: 300 + m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} + m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} + m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} + m_AmbientIntensity: 1 + m_AmbientMode: 0 + m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0} + m_HaloStrength: 0.5 + m_FlareStrength: 1 + m_FlareFadeSpeed: 3 + m_HaloTexture: {fileID: 0} + m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} + m_DefaultReflectionMode: 0 + m_DefaultReflectionResolution: 128 + m_ReflectionBounces: 1 + m_ReflectionIntensity: 1 + m_CustomReflection: {fileID: 0} + m_Sun: {fileID: 0} +--- !u!157 &3 +LightmapSettings: + m_ObjectHideFlags: 0 + serializedVersion: 6 + m_GIWorkflowMode: 0 + m_LightmapsMode: 1 + m_GISettings: + serializedVersion: 2 + m_BounceScale: 1 + m_IndirectOutputScale: 1 + m_AlbedoBoost: 1 + m_TemporalCoherenceThreshold: 1 + m_EnvironmentLightingMode: 0 + m_EnableBakedLightmaps: 1 + m_EnableRealtimeLightmaps: 1 + m_LightmapEditorSettings: + serializedVersion: 3 + m_Resolution: 2 + m_BakeResolution: 40 + m_TextureWidth: 1024 + m_TextureHeight: 1024 + m_AOMaxDistance: 1 + m_Padding: 2 + m_CompAOExponent: 0 + m_LightmapParameters: {fileID: 0} + m_TextureCompression: 1 + m_FinalGather: 0 + m_FinalGatherRayCount: 1024 + m_ReflectionCompression: 2 + m_LightingDataAsset: {fileID: 0} + m_RuntimeCPUUsage: 25 +--- !u!196 &4 +NavMeshSettings: + serializedVersion: 2 + m_ObjectHideFlags: 0 + m_BuildSettings: + serializedVersion: 2 + agentRadius: 0.5 + agentHeight: 2 + agentSlope: 45 + agentClimb: 0.4 + ledgeDropHeight: 0 + maxJumpAcrossDistance: 0 + accuratePlacement: 0 + minRegionArea: 2 + cellSize: 0.16666667 + manualCellSize: 0 + m_NavMeshData: {fileID: 0} +--- !u!1 &1653816974 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 4 + m_Component: + - 4: {fileID: 1653816976} + - 114: {fileID: 1653816977} + - 114: {fileID: 1653816978} + m_Layer: 0 + m_Name: SceneCompositionRoot + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1653816976 +Transform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1653816974} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 +--- !u!114 &1653816977 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1653816974} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 0e516af87ca41694bbaa70c373f993e0, type: 3} + m_Name: + m_EditorClassIdentifier: + _runAll: 1 + _testMethod: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 1653816978} + m_MethodName: 5465737447616d654f626a65637453656c6631 + m_Mode: 1 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: 556e697479456e67696e652e4f626a6563742c20556e697479456e67696e65 + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 1 + m_TypeName: UnityEngine.Events.UnityEvent, UnityEngine, Version=0.0.0.0, Culture=neutral, + PublicKeyToken=null +--- !u!114 &1653816978 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1653816974} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: bcae9322877b14040a778629094879c6, type: 3} + m_Name: + m_EditorClassIdentifier: + CubePrefab: {fileID: 177174, guid: 3aca5d856f350b24eb622adb19746ebc, type: 2} diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestGameObjectFactory/OneParam/TestGameObjectFactoryOneParams.unity.meta b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestGameObjectFactory/OneParam/TestGameObjectFactoryOneParams.unity.meta new file mode 100644 index 000000000..efa29085e --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestGameObjectFactory/OneParam/TestGameObjectFactoryOneParams.unity.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 10b39d81c26510b4f959b9f355299ff8 +timeCreated: 1459214356 +licenseType: Pro +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestGameObjectFactory/ZeroParams.meta b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestGameObjectFactory/ZeroParams.meta new file mode 100644 index 000000000..94669cbc3 --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestGameObjectFactory/ZeroParams.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 21f63b9c9d6721e4e95140c7f2798930 +folderAsset: yes +timeCreated: 1459095274 +licenseType: Pro +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestGameObjectFactory/ZeroParams/Fixture.cs b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestGameObjectFactory/ZeroParams/Fixture.cs new file mode 100644 index 000000000..24250c769 --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestGameObjectFactory/ZeroParams/Fixture.cs @@ -0,0 +1,90 @@ +using ModestTree.UnityUnitTester; +using UnityEngine; +using Zenject; + +namespace ModestTree.Tests.Zenject.TestGameObjectFactory.ZeroParams +{ + public class Fixture : MonoTestFixture + { + public GameObject CubePrefab; + + const string GameObjName = "TestObj"; + + [Test] + public void TestGameObjectSelf1() + { + Container.BindFactory().FromGameObject().WithGameObjectName(GameObjName); + + FixtureUtil.CallFactoryCreateMethod(Container); + + FixtureUtil.AssertNumGameObjects(Container, 1); + FixtureUtil.AssertNumGameObjectsWithName(Container, GameObjName, 1); + } + + [Test] + public void TestGameObjectConcreteSingle() + { + Container.BindFactory().To().FromGameObject().WithGameObjectName(GameObjName); + + FixtureUtil.CallFactoryCreateMethod(Container); + + FixtureUtil.AssertNumGameObjects(Container, 1); + FixtureUtil.AssertNumGameObjectsWithName(Container, GameObjName, 1); + } + + [Test] + public void TestPrefabSelfSingle1() + { + Container.BindFactory().FromPrefab(CubePrefab).WithGameObjectName(GameObjName); + + FixtureUtil.CallFactoryCreateMethod(Container); + + FixtureUtil.AssertNumGameObjects(Container, 1); + FixtureUtil.AssertNumGameObjectsWithName(Container, GameObjName, 1); + } + + [Test] + public void TestPrefabConcreteSingle1() + { + Container.BindFactory().To().FromPrefab(CubePrefab).WithGameObjectName(GameObjName); + + FixtureUtil.CallFactoryCreateMethod(Container); + + FixtureUtil.AssertNumGameObjects(Container, 1); + FixtureUtil.AssertNumGameObjectsWithName(Container, GameObjName, 1); + } + + [Test] + public void TestPrefabResourceSelfSingle1() + { + Container.BindFactory() + .FromPrefabResource("BindGameObject/Cube").WithGameObjectName(GameObjName); + + FixtureUtil.CallFactoryCreateMethod(Container); + + FixtureUtil.AssertNumGameObjects(Container, 1); + FixtureUtil.AssertNumGameObjectsWithName(Container, GameObjName, 1); + } + + [Test] + public void TestPrefabResourceConcreteSingle1() + { + Container.BindFactory() + .To().FromPrefabResource("BindGameObject/Cube").WithGameObjectName(GameObjName); + + FixtureUtil.CallFactoryCreateMethod(Container); + + FixtureUtil.AssertNumGameObjects(Container, 1); + FixtureUtil.AssertNumGameObjectsWithName(Container, GameObjName, 1); + } + + public class ObjectFactory : Factory + { + } + + public class CubeFactory : Factory + { + } + } +} + diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestGameObjectFactory/ZeroParams/Fixture.cs.meta b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestGameObjectFactory/ZeroParams/Fixture.cs.meta new file mode 100644 index 000000000..1e655616a --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestGameObjectFactory/ZeroParams/Fixture.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 0f24b347f46070f43b80467d7ab77003 +timeCreated: 1459095317 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestGameObjectFactory/ZeroParams/Resources.meta b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestGameObjectFactory/ZeroParams/Resources.meta new file mode 100644 index 000000000..f4bc26b4d --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestGameObjectFactory/ZeroParams/Resources.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 610ff771a1e202e4f99f8eedc04e0bd6 +folderAsset: yes +timeCreated: 1459098362 +licenseType: Pro +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestGameObjectFactory/ZeroParams/Resources/TestGameObjectFactory.meta b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestGameObjectFactory/ZeroParams/Resources/TestGameObjectFactory.meta new file mode 100644 index 000000000..30dc8f960 --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestGameObjectFactory/ZeroParams/Resources/TestGameObjectFactory.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 9a9e1871066bfbb4c924ceba8b2275a2 +folderAsset: yes +timeCreated: 1459098366 +licenseType: Pro +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestGameObjectFactory/ZeroParams/Resources/TestGameObjectFactory/Cube.prefab b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestGameObjectFactory/ZeroParams/Resources/TestGameObjectFactory/Cube.prefab new file mode 100644 index 000000000..ef4fdc045 --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestGameObjectFactory/ZeroParams/Resources/TestGameObjectFactory/Cube.prefab @@ -0,0 +1,88 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &177174 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 4: {fileID: 452862} + - 33: {fileID: 3315238} + - 65: {fileID: 6519334} + - 23: {fileID: 2390420} + m_Layer: 0 + m_Name: Cube + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &452862 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 177174} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 +--- !u!23 &2390420 +MeshRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 177174} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_Materials: + - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + m_SubsetIndices: + m_StaticBatchRoot: {fileID: 0} + m_UseLightProbes: 1 + m_ReflectionProbeUsage: 1 + m_ProbeAnchor: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 1 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingOrder: 0 +--- !u!33 &3315238 +MeshFilter: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 177174} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!65 &6519334 +BoxCollider: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 177174} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Size: {x: 1, y: 1, z: 1} + m_Center: {x: 0, y: 0, z: 0} +--- !u!1001 &100100000 +Prefab: + m_ObjectHideFlags: 1 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: [] + m_RemovedComponents: [] + m_ParentPrefab: {fileID: 0} + m_RootGameObject: {fileID: 177174} + m_IsPrefabParent: 1 diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestGameObjectFactory/ZeroParams/Resources/TestGameObjectFactory/Cube.prefab.meta b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestGameObjectFactory/ZeroParams/Resources/TestGameObjectFactory/Cube.prefab.meta new file mode 100644 index 000000000..9349e1761 --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestGameObjectFactory/ZeroParams/Resources/TestGameObjectFactory/Cube.prefab.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 4fd68bd3734238e43bd8b8bc25db3bcf +timeCreated: 1459095429 +licenseType: Pro +NativeFormatImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestGameObjectFactory/ZeroParams/TestGameObjectFactoryZeroParams.unity b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestGameObjectFactory/ZeroParams/TestGameObjectFactoryZeroParams.unity new file mode 100644 index 000000000..7ebefd529 --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestGameObjectFactory/ZeroParams/TestGameObjectFactoryZeroParams.unity @@ -0,0 +1,156 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!29 &1 +SceneSettings: + m_ObjectHideFlags: 0 + m_PVSData: + m_PVSObjectsArray: [] + m_PVSPortalsArray: [] + m_OcclusionBakeSettings: + smallestOccluder: 5 + smallestHole: 0.25 + backfaceThreshold: 100 +--- !u!104 &2 +RenderSettings: + m_ObjectHideFlags: 0 + serializedVersion: 6 + m_Fog: 0 + m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} + m_FogMode: 3 + m_FogDensity: 0.01 + m_LinearFogStart: 0 + m_LinearFogEnd: 300 + m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} + m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} + m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} + m_AmbientIntensity: 1 + m_AmbientMode: 0 + m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0} + m_HaloStrength: 0.5 + m_FlareStrength: 1 + m_FlareFadeSpeed: 3 + m_HaloTexture: {fileID: 0} + m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} + m_DefaultReflectionMode: 0 + m_DefaultReflectionResolution: 128 + m_ReflectionBounces: 1 + m_ReflectionIntensity: 1 + m_CustomReflection: {fileID: 0} + m_Sun: {fileID: 0} +--- !u!157 &3 +LightmapSettings: + m_ObjectHideFlags: 0 + serializedVersion: 6 + m_GIWorkflowMode: 0 + m_LightmapsMode: 1 + m_GISettings: + serializedVersion: 2 + m_BounceScale: 1 + m_IndirectOutputScale: 1 + m_AlbedoBoost: 1 + m_TemporalCoherenceThreshold: 1 + m_EnvironmentLightingMode: 0 + m_EnableBakedLightmaps: 1 + m_EnableRealtimeLightmaps: 1 + m_LightmapEditorSettings: + serializedVersion: 3 + m_Resolution: 2 + m_BakeResolution: 40 + m_TextureWidth: 1024 + m_TextureHeight: 1024 + m_AOMaxDistance: 1 + m_Padding: 2 + m_CompAOExponent: 0 + m_LightmapParameters: {fileID: 0} + m_TextureCompression: 1 + m_FinalGather: 0 + m_FinalGatherRayCount: 1024 + m_ReflectionCompression: 2 + m_LightingDataAsset: {fileID: 0} + m_RuntimeCPUUsage: 25 +--- !u!196 &4 +NavMeshSettings: + serializedVersion: 2 + m_ObjectHideFlags: 0 + m_BuildSettings: + serializedVersion: 2 + agentRadius: 0.5 + agentHeight: 2 + agentSlope: 45 + agentClimb: 0.4 + ledgeDropHeight: 0 + maxJumpAcrossDistance: 0 + accuratePlacement: 0 + minRegionArea: 2 + cellSize: 0.16666667 + manualCellSize: 0 + m_NavMeshData: {fileID: 0} +--- !u!1 &1653816974 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 4 + m_Component: + - 4: {fileID: 1653816976} + - 114: {fileID: 1653816977} + - 114: {fileID: 1653816978} + m_Layer: 0 + m_Name: SceneCompositionRoot + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1653816976 +Transform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1653816974} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 +--- !u!114 &1653816977 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1653816974} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 0e516af87ca41694bbaa70c373f993e0, type: 3} + m_Name: + m_EditorClassIdentifier: + _runAll: 1 + _testMethod: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 1653816978} + m_MethodName: 5465737447616d654f626a65637453656c6631 + m_Mode: 1 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: 556e697479456e67696e652e4f626a6563742c20556e697479456e67696e65 + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 1 + m_TypeName: UnityEngine.Events.UnityEvent, UnityEngine, Version=0.0.0.0, Culture=neutral, + PublicKeyToken=null +--- !u!114 &1653816978 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1653816974} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 0f24b347f46070f43b80467d7ab77003, type: 3} + m_Name: + m_EditorClassIdentifier: + CubePrefab: {fileID: 177174, guid: 4fd68bd3734238e43bd8b8bc25db3bcf, type: 2} diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestGameObjectFactory/ZeroParams/TestGameObjectFactoryZeroParams.unity.meta b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestGameObjectFactory/ZeroParams/TestGameObjectFactoryZeroParams.unity.meta new file mode 100644 index 000000000..89a048e14 --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Factories/TestGameObjectFactory/ZeroParams/TestGameObjectFactoryZeroParams.unity.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 3eee376fc44bd264f8e7a1d69f0cbac5 +timeCreated: 1459095317 +licenseType: Pro +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Runner.meta b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Runner.meta new file mode 100644 index 000000000..d6655564c --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Runner.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 5cc9453c60e642c439ba715c77a00456 +folderAsset: yes +timeCreated: 1462057592 +licenseType: Pro +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Runner/MonoTestFixture.cs b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Runner/MonoTestFixture.cs new file mode 100644 index 000000000..b6dc8ee2b --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Runner/MonoTestFixture.cs @@ -0,0 +1,16 @@ +using System; +using UnityEngine; +using Zenject; + +namespace ModestTree.UnityUnitTester +{ + public class MonoTestFixture : MonoBehaviour + { + public DiContainer Container + { + get; + set; + } + } +} + diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Runner/MonoTestFixture.cs.meta b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Runner/MonoTestFixture.cs.meta new file mode 100644 index 000000000..15f4ff82d --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Runner/MonoTestFixture.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 366fd48d2e243b44280ce5e0dab29938 +timeCreated: 1458225441 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Runner/TestAttribute.cs b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Runner/TestAttribute.cs new file mode 100644 index 000000000..2b5e0cfa3 --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Runner/TestAttribute.cs @@ -0,0 +1,19 @@ +using System; + +namespace ModestTree.UnityUnitTester +{ + [AttributeUsage(AttributeTargets.Method, AllowMultiple = false)] + public class TestAttribute : Attribute + { + } + + [AttributeUsage(AttributeTargets.Method, AllowMultiple = false)] + public class ExpectedExceptionAttribute : Attribute + { + } + + [AttributeUsage(AttributeTargets.Method, AllowMultiple = false)] + public class ExpectedValidationExceptionAttribute : Attribute + { + } +} diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Runner/TestAttribute.cs.meta b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Runner/TestAttribute.cs.meta new file mode 100644 index 000000000..8289a690a --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Runner/TestAttribute.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: c67f0be581036284aae1205ecff23fcc +timeCreated: 1458225782 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Runner/UnityUnitTestMultiRunner.cs b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Runner/UnityUnitTestMultiRunner.cs new file mode 100644 index 000000000..be145f89d --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Runner/UnityUnitTestMultiRunner.cs @@ -0,0 +1,196 @@ + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; +using System.Reflection; +using ModestTree.Util; +using UnityEngine; +using UnityEngine.Events; +using UnityEngine.SceneManagement; +using UnityEngine.Serialization; +using Zenject; + +#if UNITY_EDITOR +using UnityEditor; +#endif + +namespace ModestTree.UnityUnitTester +{ + public class UnityUnitTestMultiRunner : MonoBehaviour + { + [SerializeField] + [FormerlySerializedAs("_waitTime")] + public float WaitTime = 0.5f; + + bool _hitAnyError; + bool _suppressAllErrors; + bool _hasFailed; + + public void Start() + { + StartCoroutine(Run()); + ListenOnAllErrors(); + + Debug.Log("Starting UnityUnitTestMultiRunner..."); + } + + IEnumerator Run() + { + foreach (var fixture in GameObject.FindObjectsOfType()) + { + var testMethods = fixture.GetType().GetAllInstanceMethods() + .Where(x => x.GetCustomAttributes(typeof(TestAttribute), false).Any()); + + foreach (var methodInfo in testMethods) + { + yield return StartCoroutine(RunFixture(fixture, methodInfo, true)); + + if (_hasFailed) + { + break; + } + + yield return StartCoroutine(RunFixture(fixture, methodInfo, false)); + + if (_hasFailed) + { + break; + } + } + + if (_hasFailed) + { + break; + } + } + + if (_hasFailed) + { + Log.Error("Unity Unit Tests failed with errors"); + } + else + { + Log.Info("Unity Unit Tests passed successfully"); + } + +#if UNITY_EDITOR + EditorApplication.isPlaying = false; +#endif + } + + IEnumerator RunFixture(MonoTestFixture fixture, MethodInfo methodInfo, bool validateOnly) + { + // These should be reset each time + Assert.That(!_suppressAllErrors, "_suppressAllErrors is false"); + + bool isExpectingErrorDuringTest; + + if (validateOnly) + { + isExpectingErrorDuringTest = methodInfo.HasAttribute(); + } + else + { + isExpectingErrorDuringTest = methodInfo.HasAttribute(); + } + + var testName = "{0}.{1}".Fmt(fixture.GetType().Name(), methodInfo.Name); + + Log.Trace("{0} test '{1}'{2}", validateOnly ? "Validating" : "Running", testName, isExpectingErrorDuringTest ? "(expecting error)" : ""); + + var compRoot = SceneCompositionRoot.Create(); + + // Put under ourself otherwise it disables us during validation + compRoot.transform.parent = this.transform; + + compRoot.IsValidating = validateOnly; + compRoot.ValidateShutDownAfterwards = false; + + compRoot.NormalInstallers = new Installer[] + { + new ActionInstaller((container) => + { + fixture.Container = container; + methodInfo.Invoke(fixture, new object[0]); + container.FlushBindings(); + }) + }; + + compRoot.ParentNewObjectsUnderRoot = true; + + _hitAnyError = false; + _suppressAllErrors = isExpectingErrorDuringTest; + + try + { + compRoot.Run(); + } + catch (Exception e) + { + Debug.LogException(e); + } + + if (!validateOnly) + { + yield return new WaitForSeconds(WaitTime); + } + + _suppressAllErrors = false; + bool hitErrorDuringTest = _hitAnyError; + + GameObject.Destroy(compRoot.gameObject); + + yield return null; + + if (isExpectingErrorDuringTest) + { + if (hitErrorDuringTest) + { + Log.Trace("Hit expected error during test '{0}'. Ignoring.", testName); + } + else + { + Log.Error("Expected to hit error during test '{0}' but none was found!", testName); + _hasFailed = true; + } + } + else + { + if (hitErrorDuringTest) + { + _hasFailed = true; + } + } + } + + void ListenOnAllErrors() + { + Application.logMessageReceived += OnLogCallback; + } + + public void OnLogCallback(string message, string stackTrace, LogType logType) + { + if (logType == LogType.Assert || logType == LogType.Error || logType == LogType.Exception) + { + _hitAnyError = true; + } + } + + public class ActionInstaller : Installer + { + readonly Action _installMethod; + + public ActionInstaller(Action installMethod) + { + _installMethod = installMethod; + } + + public override void InstallBindings() + { + _installMethod(Container); + } + } + } +} + diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Runner/UnityUnitTestMultiRunner.cs.meta b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Runner/UnityUnitTestMultiRunner.cs.meta new file mode 100644 index 000000000..9f79a874f --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Runner/UnityUnitTestMultiRunner.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: f3c1011000183804db9d595347f46d0a +timeCreated: 1461365344 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Runner/UnityUnitTestRunner.cs b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Runner/UnityUnitTestRunner.cs new file mode 100644 index 000000000..0f5b19ddd --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Runner/UnityUnitTestRunner.cs @@ -0,0 +1,52 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; +using System.Reflection; +using ModestTree.Util; +using UnityEngine; +using UnityEngine.Events; +using UnityEngine.SceneManagement; +using UnityEngine.Serialization; +using Zenject; + +#if UNITY_EDITOR +using UnityEditor; +#endif + +namespace ModestTree.UnityUnitTester +{ + public class UnityUnitTestRunner : MonoBehaviour + { + [SerializeField] + bool _runAll; + + [SerializeField] + UnityEvent _testMethod; + + public void Awake() + { + if (_runAll) + { + gameObject.AddComponent(); + } + else + { + var installer = gameObject.AddComponent(); + installer.TestMethod = _testMethod; + + var compRoot = SceneCompositionRoot.CreateComponent(gameObject); + + compRoot.ParentNewObjectsUnderRoot = true; + + compRoot.Installers = new List() + { + installer + }; + + compRoot.Run(); + } + } + } +} + diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Runner/UnityUnitTestRunner.cs.meta b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Runner/UnityUnitTestRunner.cs.meta new file mode 100644 index 000000000..87b0a0c4a --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Runner/UnityUnitTestRunner.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 0e516af87ca41694bbaa70c373f993e0 +timeCreated: 1461366294 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: -10100 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Runner/UnityUnitTestSingleRunnerInstaller.cs b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Runner/UnityUnitTestSingleRunnerInstaller.cs new file mode 100644 index 000000000..8a00e7bbc --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Runner/UnityUnitTestSingleRunnerInstaller.cs @@ -0,0 +1,57 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; +using System.Reflection; +using ModestTree.Util; +using UnityEngine; +using UnityEngine.Events; +using UnityEngine.SceneManagement; +using UnityEngine.Serialization; +using Zenject; + +#if UNITY_EDITOR +using UnityEditor; +#endif + +namespace ModestTree.UnityUnitTester +{ + public class UnityUnitTestSingleRunnerInstaller : MonoInstaller + { + [SerializeField] + float _waitTime = 0.5f; + + [SerializeField] + UnityEvent _testMethod; + + public UnityEvent TestMethod + { + get + { + return _testMethod; + } + set + { + _testMethod = value; + } + } + + public override void InstallBindings() + { + foreach (var fixture in GameObject.FindObjectsOfType()) + { + fixture.Container = Container; + } + + _testMethod.Invoke(); + + this.StartCoroutine(DelayThenPrintResult()); + } + + IEnumerator DelayThenPrintResult() + { + yield return new WaitForSeconds(_waitTime); + Log.Info("Completed running selected fixture"); + } + } +} diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Runner/UnityUnitTestSingleRunnerInstaller.cs.meta b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Runner/UnityUnitTestSingleRunnerInstaller.cs.meta new file mode 100644 index 000000000..2b7f55df6 --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Runner/UnityUnitTestSingleRunnerInstaller.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 0c4d600a5e4385d41bbb17bea1fbbb35 +timeCreated: 1461366825 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Util.meta b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Util.meta new file mode 100644 index 000000000..504ea1b66 --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Util.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: c1a0f4d44afa2d04fa5df73418c6b98d +folderAsset: yes +timeCreated: 1462057592 +licenseType: Pro +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Util/ComponentCountAsserter.cs b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Util/ComponentCountAsserter.cs new file mode 100644 index 000000000..e177b1557 --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Util/ComponentCountAsserter.cs @@ -0,0 +1,32 @@ +using System; +using Zenject; +using UnityEngine; +using System.Linq; + +namespace ModestTree.Tests.Zenject +{ + public class ComponentCountAsserter : IInitializable + { + readonly int _expectedCount; + + public ComponentCountAsserter(int expectedCount) + { + _expectedCount = expectedCount; + } + + public void Initialize() + { + Assert.That(typeof(TComponent).DerivesFromOrEqual() || typeof(TComponent).IsAbstract); + + var num = GameObject.FindObjectsOfType() + .SelectMany(x => x.gameObject.GetComponents()).Count(); + + Assert.That(num == _expectedCount, + "Expected to find '{0}' components of type '{1}' but instead found '{2}'", + _expectedCount, typeof(TComponent).Name(), num); + + Log.Info("Correctly detected '{0}' components of type '{1}'", + _expectedCount, typeof(TComponent).Name()); + } + } +} diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Util/ComponentCountAsserter.cs.meta b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Util/ComponentCountAsserter.cs.meta new file mode 100644 index 000000000..3c8ee59b7 --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Util/ComponentCountAsserter.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 5de18a1c5c657024c81001146ea032d0 +timeCreated: 1458929956 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Util/FactoryUser.cs b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Util/FactoryUser.cs new file mode 100644 index 000000000..9a766b7ba --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Util/FactoryUser.cs @@ -0,0 +1,24 @@ +using System; +using Zenject; +using UnityEngine; +using System.Linq; + +namespace ModestTree.Tests.Zenject +{ + public class FactoryUser : IInitializable + where TFactory : Factory + { + readonly TFactory _factory; + + public FactoryUser(TFactory factory) + { + _factory = factory; + } + + public void Initialize() + { + Assert.IsNotNull(_factory.Create()); + } + } +} + diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Util/FactoryUser.cs.meta b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Util/FactoryUser.cs.meta new file mode 100644 index 000000000..9b92b8d98 --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Util/FactoryUser.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 42114fc6d3681b644846de2eaf1bad35 +timeCreated: 1459027439 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Util/FixtureUtil.cs b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Util/FixtureUtil.cs new file mode 100644 index 000000000..a03bfa777 --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Util/FixtureUtil.cs @@ -0,0 +1,67 @@ +using System; +using UnityEngine; +using Zenject; + +namespace ModestTree.Tests.Zenject +{ + public static class FixtureUtil + { + public static void AddInitMethod( + DiContainer container, Action method) + { + container.Bind() + .To().WithArguments(method); + } + + public static void AddInitMethod( + DiContainer container, Action method) + { + container.Bind() + .To>().WithArguments(method); + } + + public static void AddInitMethod( + DiContainer container, Action method) + { + container.Bind() + .To>().WithArguments(method); + } + + public static void AssertNumGameObjects( + DiContainer container, int expectedNumGameObjects) + { + container.Bind() + .To().WithArguments(expectedNumGameObjects); + } + + public static void AssertResolveCount( + DiContainer container, int expectedNum) + { + container.Bind() + .To>().WithArguments(expectedNum); + } + + public static void AssertComponentCount( + DiContainer container, int expectedNumComponents) + { + container.Bind() + .To>().WithArguments(expectedNumComponents); + } + + public static void AssertNumGameObjectsWithName( + DiContainer container, string name, int expectedNumGameObjects) + { + container.Bind() + .To().WithArguments(name, expectedNumGameObjects); + } + + public static void CallFactoryCreateMethod(DiContainer container) + where TFactory : Factory + { + container.Bind().To>().AsCached(); + + // Always create first so that you can use the asserts above + container.BindInitializableExecutionOrder>(-1); + } + } +} diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Util/FixtureUtil.cs.meta b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Util/FixtureUtil.cs.meta new file mode 100644 index 000000000..4c4b65f68 --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Util/FixtureUtil.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 68e0607803f00f24dbd0ef8c1085831a +timeCreated: 1458931511 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Util/GameObjectCountAsserter.cs b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Util/GameObjectCountAsserter.cs new file mode 100644 index 000000000..7275a7e7a --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Util/GameObjectCountAsserter.cs @@ -0,0 +1,28 @@ +using System; +using Zenject; +using UnityEngine; + +namespace ModestTree.Tests.Zenject +{ + public class GameObjectCountAsserter : IInitializable + { + readonly GameObject _root; + readonly int _expectedCount; + + public GameObjectCountAsserter( + int expectedCount, + CompositionRoot root) + { + _root = root.gameObject; + _expectedCount = expectedCount; + } + + public void Initialize() + { + Assert.IsEqual(_root.transform.childCount, _expectedCount); + + Log.Info("Correctly detected '{0}' game objects", _expectedCount); + } + } +} + diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Util/GameObjectCountAsserter.cs.meta b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Util/GameObjectCountAsserter.cs.meta new file mode 100644 index 000000000..a87730473 --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Util/GameObjectCountAsserter.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: bfd3203840ee08b4383f5054a5215071 +timeCreated: 1458930632 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Util/GameObjectNameCountAsserter.cs b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Util/GameObjectNameCountAsserter.cs new file mode 100644 index 000000000..eb8eb94f1 --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Util/GameObjectNameCountAsserter.cs @@ -0,0 +1,36 @@ +using System; +using Zenject; +using UnityEngine; +using System.Linq; + +namespace ModestTree.Tests.Zenject +{ + public class GameObjectNameCountAsserter : IInitializable + { + readonly GameObject _root; + readonly int _expectedCount; + readonly string _name; + + public GameObjectNameCountAsserter( + string name, + int expectedCount, + CompositionRoot root) + { + _name = name; + _root = root.gameObject; + _expectedCount = expectedCount; + } + + public void Initialize() + { + Assert.IsEqual( + _root.transform.Cast() + .Where(x => x.name == _name).Count(), + _expectedCount); + + Log.Info("Correctly detected '{0}' game objects with name '{1}'", _expectedCount, _name); + } + } +} + + diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Util/GameObjectNameCountAsserter.cs.meta b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Util/GameObjectNameCountAsserter.cs.meta new file mode 100644 index 000000000..603e86e84 --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Util/GameObjectNameCountAsserter.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: ec849ef57d75ecb4d86cb9173c70ac8b +timeCreated: 1458931511 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Util/InitMethodHandler.cs b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Util/InitMethodHandler.cs new file mode 100644 index 000000000..2fc3cd090 --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Util/InitMethodHandler.cs @@ -0,0 +1,61 @@ +using System; +using Zenject; + +namespace ModestTree.Tests.Zenject +{ + public class InitMethodHandler : IInitializable + { + readonly Action _method; + + public InitMethodHandler(Action method) + { + _method = method; + } + + public void Initialize() + { + _method(); + } + } + + public class InitMethodHandler : IInitializable + { + readonly TParam1 _param1; + readonly Action _method; + + public InitMethodHandler( + Action method, + TParam1 param1) + { + _param1 = param1; + _method = method; + } + + public void Initialize() + { + _method(_param1); + } + } + + public class InitMethodHandler : IInitializable + { + readonly TParam1 _param1; + readonly TParam2 _param2; + readonly Action _method; + + public InitMethodHandler( + Action method, + TParam1 param1, + TParam2 param2) + { + _param1 = param1; + _param2 = param2; + _method = method; + } + + public void Initialize() + { + _method(_param1, _param2); + } + } +} diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Util/InitMethodHandler.cs.meta b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Util/InitMethodHandler.cs.meta new file mode 100644 index 000000000..1fb1f9c3d --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Util/InitMethodHandler.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: a8f879495237a25449d35066397db5f4 +timeCreated: 1459207155 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Util/ResolveCountAsserter.cs b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Util/ResolveCountAsserter.cs new file mode 100644 index 000000000..64f58cde4 --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Util/ResolveCountAsserter.cs @@ -0,0 +1,32 @@ +using System; +using Zenject; +using UnityEngine; +using System.Collections.Generic; + +namespace ModestTree.Tests.Zenject +{ + public class ResolveCountAsserter : IInitializable + { + readonly int _expectedCount; + readonly List _results; + + public ResolveCountAsserter( + [InjectOptional] + List results, + int expectedCount) + { + _results = results; + _expectedCount = expectedCount; + } + + public void Initialize() + { + Assert.That(_results.Count == _expectedCount, + "Expected to find '{0}' instances of type '{1}' but instead found '{2}'", + _expectedCount, typeof(TContract).Name(), _results.Count); + + Log.Info("Correctly resolved '{0}' objects with type '{1}'", _expectedCount, typeof(TContract).Name()); + } + } +} + diff --git a/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Util/ResolveCountAsserter.cs.meta b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Util/ResolveCountAsserter.cs.meta new file mode 100644 index 000000000..20d198016 --- /dev/null +++ b/UnityProject/Assets/Zenject/OptionalExtras/IntegrationTests/Util/ResolveCountAsserter.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 2515245321de4e545bf652e19af813c7 +timeCreated: 1459008624 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: