Example #1
0
        public void Set_Up_Unit_UI_From_Template_And_Pass_It_To_Manager()
        {
            //Arrange
            IUnit                   unit       = A.MockUnit().Build();
            UnitUIManager           manager    = new GameObject().AddComponent <UnitUIManager>();
            IUnitUIFactory          factory    = A.MockUnitUIFactory().With(manager).Build();
            UnitUIFactoryController controller = new UnitUIFactoryController(factory);
            UnitUI                  toSetUp    = new GameObject().AddComponent <UnitUI>();

            //Act
            controller.SetUpUnitUI(toSetUp, unit);

            //Assert
            Assert.AreEqual(toSetUp.dataToSend, unit);
            Assert.IsTrue(manager.workers.Contains(toSetUp));
        }
Example #2
0
 private void Awake()
 {
     _controller      = new UnitUIFactoryController(this);
     _eventController = new UnitEventListenerController(this, gameObject);
     _eventController.AddListenerComponent();
 }