Пример #1
0
        public void CreateNonMonoServiceAndResolveIt()
        {
            serviceLocatorManager.Register <IMockInterface>(new MockServiceOldFeature());

            IMockInterface oldService = serviceLocatorManager.Resolve <IMockInterface>();

            Assert.IsInstanceOf(typeof(MockServiceOldFeature), oldService);
        }
Пример #2
0
        public void CreateMonoServiceAndResolveIt()
        {
            ServiceLocatorManager.Register <IMockInterface>(ServiceLocatorManager.AsMono <MonoMockServiceFeature>());

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

            Assert.IsInstanceOf(typeof(MonoMockServiceFeature), service);
        }
Пример #3
0
        public void CreateNonMonoServiceDeleteItAndResolveIt()
        {
            Debug.logger.logEnabled = false;
            ServiceLocatorManager.Register <IMockInterface>(new MockServiceOldFeature());

            ServiceLocatorManager.Reset();

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

            Assert.IsNull(service);
        }
Пример #4
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);
        }