Example #1
0
        public void CreateMonoServiceAndResolveIt()
        {
            ServiceLocatorManager.Register <IMockInterface>(ServiceLocatorManager.AsMono <MonoMockServiceFeature>());

            IMockInterface service = ServiceLocatorManager.Resolve <IMockInterface>();

            Assert.IsInstanceOf(typeof(MonoMockServiceFeature), service);
        }
Example #2
0
        public void CreateMonoServiceResetItAndResolveIt()
        {
            Debug.unityLogger.logEnabled = false;

            serviceLocatorManager.Register <IMockInterface>(ServiceLocatorManager.AsMono <MonoMockServiceFeature>());

            serviceLocatorManager.Reset();

            IMockInterface service = serviceLocatorManager.Resolve <IMockInterface>();
            var            obj     = Object.FindObjectOfType <MonoMockServiceFeature>();

            Assert.IsNull(obj);
        }
Example #3
0
        public IEnumerator CreateMonoServiceResetItAndResolveIt()
        {
            Debug.logger.logEnabled = false;

            ServiceLocatorManager.Register <IMockInterface>(ServiceLocatorManager.AsMono <MonoMockServiceFeature>());

            ServiceLocatorManager.Reset();

            IMockInterface service = ServiceLocatorManager.Resolve <IMockInterface>();

            Assert.IsNull(service);
            yield return(new WaitForEndOfFrame());

            var obj = Object.FindObjectOfType <MonoMockServiceFeature>();

            Assert.IsNull(obj);
        }