コード例 #1
0
        public void CreateNonMonoServiceDeleteItAndResolveIt()
        {
            Debug.logger.logEnabled = false;
            ServiceLocatorManager.Register <IMockInterface>(new MockServiceOldFeature());

            ServiceLocatorManager.Reset();

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

            Assert.IsNull(service);
        }
コード例 #2
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);
        }