public void RegisterAOT_T_Correct() { //Arrange var container = new InjectionContainer(); ICommandDispatcher dispatcher; someClass sc = new someClass(); //Act container .RegisterAOT <UnityContainerAOT>() .RegisterAOT <EventContainerAOT>() .RegisterAOT <CommanderContainerAOT>() .RegisterCommand <TestCommand1>() .Bind <Transform>().ToPrefab("06_Commander/Prism"); container.PoolCommands(); dispatcher = container.GetCommandDispatcher(); dispatcher.Dispatch <TestCommand1>(sc); //Assert Assert.AreEqual( true, dispatcher != null && sc.id == 1 && container.GetTypes <Transform>().Count == 1 && ((PrefabInfo)container.GetTypes <Transform>()[0].value).path == "06_Commander/Prism"); }
public void ReBind_FactoryBinding_BinderSaveCorrect() { //Arrange IBinder binder = new Binder(); someClass o = new someClass(); //Act binder.BindFactory <someClass>().To(o).BindSingleton <someClass>().To(new someClass()); //Assert Assert.AreEqual(2, binder.GetAll().Count); }
public void ToInstance_FactoryBinding_BinderSaveCorrect() { //Arrange IBinder binder = new Binder(); someClass o = new someClass(); //Act binder.BindFactory <someClass>().To(o); //Assert Assert.AreEqual( true, binder.GetAll().Count == 1 && binder.GetAll()[0].value == o); }