public void UpdateLandCorrectly() { const string startingName = "Temptation"; const string updatedName = "New Temptation"; SectionLandController controller = new SectionLandController(view); ILandsListener landsListener = controller; LandElementView landElementView = view.GetLandElementeBaseView(); landsListener.OnSetLands(new [] { new LandData() { id = "1", name = startingName } }); Assert.AreEqual(1, GetVisibleChildrenAmount(view.GetLandElementsContainer())); Assert.AreEqual(startingName, landElementView.landName.text); landsListener.OnSetLands(new [] { new LandData() { id = "1", name = updatedName } }); Assert.AreEqual(1, GetVisibleChildrenAmount(view.GetLandElementsContainer())); Assert.AreEqual(updatedName, landElementView.landName.text); controller.Dispose(); }
public void SetLandsCorrectly() { SectionLandController controller = new SectionLandController(view); ILandsListener landsListener = controller; landsListener.OnSetLands(new [] { new LandData() { id = "1" }, new LandData() { id = "2" } }); Assert.AreEqual(2, GetVisibleChildrenAmount(view.GetLandElementsContainer())); Assert.IsTrue(view.contentContainer.activeSelf); landsListener.OnSetLands(new [] { new LandData() { id = "1" } }); Assert.AreEqual(1, GetVisibleChildrenAmount(view.GetLandElementsContainer())); Assert.IsTrue(view.contentContainer.activeSelf); landsListener.OnSetLands(new LandData[] {}); Assert.AreEqual(0, GetVisibleChildrenAmount(view.GetLandElementsContainer())); Assert.IsFalse(view.contentContainer.activeSelf); Assert.IsTrue(view.emptyContainer.activeSelf); controller.Dispose(); }
void ILandController.RemoveListener(ILandsListener listener) { OnLandsSet -= listener.OnSetLands; }
void ILandController.AddListener(ILandsListener listener) { OnLandsSet += listener.OnSetLands; listener.OnSetLands(userLands); }
public void RemoveListener(ILandsListener listener) { OnLandsSet -= listener.OnSetLands; }
public void AddListener(ILandsListener listener) { OnLandsSet += listener.OnSetLands; listener.OnSetLands(userLands); }