Exemplo n.º 1
0
        public void TestAbstractBindingConcreteSearch()
        {
            // Should ignore the Norf2 component on it
            Container.Bind <INorf>().To <Norf>().FromPrefabResource(PathPrefix + "Norf");

            FixtureUtil.AssertNumGameObjects(Container, 1);
            FixtureUtil.AssertResolveCount <INorf>(Container, 2);
        }
Exemplo n.º 2
0
        public void TestZeroArgs()
        {
            FooInstaller.Install(Container);

            Initialize();

            FixtureUtil.AssertResolveCount <Foo>(Container, 1);
        }
Exemplo n.º 3
0
        public void TestZeroArgs()
        {
            FooInstaller.InstallFromResource("TestScriptableObjectInstallers/FooInstaller", Container);

            Initialize();

            FixtureUtil.AssertResolveCount <Foo>(Container, 1);
        }
        public IEnumerator TestZeroParametersDeep()
        {
            PreInstall();
            CompositeScriptableObjectInstaller.InstallFromResource("TestCompositeScriptableObjectInstallers/FooInstaller/TestCompositeScriptableObjectDeepFooInstaller1", Container);
            PostInstall();

            FixtureUtil.AssertResolveCount <Foo>(Container, 1);
            yield break;
        }
        public IEnumerator TestZeroParameters()
        {
            PreInstall();
            InstallCompositeMonoInstallerFromResource("TestCompositeMonoInstallers/FooInstaller/TestCompositeMonoFooInstaller", Container);
            PostInstall();

            FixtureUtil.AssertResolveCount <Foo>(Container, 1);
            yield break;
        }
        public IEnumerator TestZeroArgs()
        {
            PreInstall();
            FooInstaller.InstallFromResource("TestScriptableObjectInstallers/FooInstaller", Container);

            PostInstall();

            FixtureUtil.AssertResolveCount <Foo>(Container, 1);
            yield break;
        }
Exemplo n.º 7
0
        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 <INorf>().FromPrefabResource(PathPrefix + "Norf");

            FixtureUtil.AssertNumGameObjects(Container, 1);
            FixtureUtil.AssertComponentCount <INorf>(Container, 3);
            FixtureUtil.AssertResolveCount <INorf>(Container, 3);
        }
        public IEnumerator TestZeroArgs()
        {
            PreInstall();
            FooInstaller.Install(Container);

            PostInstall();

            FixtureUtil.AssertResolveCount <Foo>(Container, 1);
            yield break;
        }
Exemplo n.º 9
0
        public void TestAbstractBindingConcreteSearch()
        {
            // Should ignore the Norf2 component on it
            Container.Bind <INorf>().To <Norf>().FromComponentInNewPrefab(NorfPrefab).AsTransient().NonLazy();

            Initialize();

            FixtureUtil.AssertNumGameObjects(Container, 1);
            FixtureUtil.AssertResolveCount <INorf>(Container, 2);
        }
        public IEnumerator TestMultipleInstallersDeep()
        {
            PreInstall();
            CompositeScriptableObjectInstaller.InstallFromResource("TestCompositeScriptableObjectInstallers/FooInjecteeInstaller/TestCompositeSOFooInjecteeInstaller", Container);
            CompositeScriptableObjectInstaller.InstallFromResource("TestCompositeScriptableObjectInstallers/FooInstaller/TestCompositeScriptableObjectFooInstaller", Container);
            PostInstall();

            FixtureUtil.AssertResolveCount <Foo>(Container, 1);
            FixtureUtil.AssertResolveCount <FooInjectee>(Container, 1);
            yield break;
        }
Exemplo n.º 11
0
        public IEnumerator TestMultipleInstallersDeep()
        {
            PreInstall();
            InstallCompositeMonoInstallerFromResource("TestCompositeMonoInstaller/FooInjecteeInstaller/TestCompositeMonoFooInjecteeInstaller", Container);
            InstallCompositeMonoInstallerFromResource("TestCompositeMonoInstaller/FooInstaller/TestCompositeMonoFooInstaller", Container);
            PostInstall();

            FixtureUtil.AssertResolveCount <Foo>(Container, 1);
            FixtureUtil.AssertResolveCount <FooInjectee>(Container, 1);
            yield break;
        }
        public IEnumerator TestAbstractBindingConcreteSearch()
        {
            PreInstall();
            // Should ignore the Norf2 component on it
            Container.Bind <INorf>().To <Norf>().FromComponentInNewPrefabResource(PathPrefix + "Norf").AsTransient().NonLazy();

            PostInstall();

            FixtureUtil.AssertNumGameObjects(1);
            FixtureUtil.AssertResolveCount <INorf>(Container, 2);
            yield break;
        }
Exemplo n.º 13
0
        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 <INorf>().FromComponentInNewPrefab(NorfPrefab).AsTransient().NonLazy();

            Initialize();

            FixtureUtil.AssertNumGameObjects(Container, 1);
            FixtureUtil.AssertComponentCount <INorf>(Container, 3);
            FixtureUtil.AssertResolveCount <INorf>(Container, 3);
        }
        public IEnumerator TestWithAbstractSearchSingleMatch()
        {
            PreInstall();
            // There are three components that implement INorf on this prefab
            Container.Bind <INorf>().FromComponentInNewPrefabResource(PathPrefix + "Norf").AsCached().NonLazy();

            PostInstall();

            FixtureUtil.AssertNumGameObjects(1);
            FixtureUtil.AssertComponentCount <INorf>(3);
            FixtureUtil.AssertResolveCount <INorf>(Container, 1);
            yield break;
        }
        public IEnumerator TestWithAbstractSearch()
        {
            PreInstall();
            // There are three components that implement INorf on this prefab
            // and so this should result in a list of 3 INorf's
            Container.Bind <INorf>().FromComponentInNewPrefabResource(PathPrefix + "Norf").AsTransient().NonLazy();

            PostInstall();

            FixtureUtil.AssertNumGameObjects(1);
            FixtureUtil.AssertComponentCount <INorf>(3);
            FixtureUtil.AssertResolveCount <INorf>(Container, 3);
            yield break;
        }