public void Bind_Resolve_Successfully() { MainInstaller.Bind <IInterface>(new Implementation()); var instance = MainInstaller.Resolve <IInterface>(); Assert.IsNotNull(instance); Assert.AreSame(typeof(Implementation), instance.GetType()); }
private void Awake() { var messageBroker = new MessageBrokerService(); var timeService = new TimeService(); var dataService = new DataService(); var configsProvider = new ConfigsProvider(); var uiService = new GameUiService(new UiAssetLoader()); var worldObjectReference = new WorldObjectReferenceService(_inputSystem, _mainCamera); var gameLogic = new GameLogic(messageBroker, timeService, dataService, configsProvider); var gameServices = new GameServices(messageBroker, timeService, dataService, gameLogic, worldObjectReference); MainInstaller.Bind <IGameDataProvider>(gameLogic); MainInstaller.Bind <IGameServices>(gameServices); _stateMachine = new GameStateMachine(gameLogic, gameServices, uiService, configsProvider, dataService); }
public void Bind_NotInterface_ThrowsException() { Assert.Throws <ArgumentException>(() => MainInstaller.Bind(new Implementation())); }