public void CreateMonoServiceAndResolveIt() { ServiceLocatorManager.Register <IMockInterface>(ServiceLocatorManager.AsMono <MonoMockServiceFeature>()); IMockInterface service = ServiceLocatorManager.Resolve <IMockInterface>(); Assert.IsInstanceOf(typeof(MonoMockServiceFeature), service); }
public void CreateNonMonoServiceAndResolveIt() { ServiceLocatorManager.Register <IMockInterface>(new MockServiceOldFeature()); IMockInterface oldService = ServiceLocatorManager.Resolve <IMockInterface>(); Assert.IsInstanceOf(typeof(MockServiceOldFeature), oldService); }
public void CreateNonMonoServiceDeleteItAndResolveIt() { Debug.logger.logEnabled = false; ServiceLocatorManager.Register <IMockInterface>(new MockServiceOldFeature()); ServiceLocatorManager.Reset(); IMockInterface service = ServiceLocatorManager.Resolve <IMockInterface>(); Assert.IsNull(service); }
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); }