示例#1
0
        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();
        }
示例#2
0
        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();
        }
示例#3
0
        public void ShowAndHideCorrectly()
        {
            SectionLandController controller = new SectionLandController(view);

            controller.SetVisible(true);

            controller.SetVisible(false);
            Assert.IsFalse(view.gameObject.activeSelf);

            controller.SetVisible(true);
            Assert.IsTrue(view.gameObject.activeSelf);
            controller.Dispose();
        }
示例#4
0
    SectionBase ISectionFactory.GetSectionController(SectionId id)
    {
        SectionBase result = null;

        switch (id)
        {
        case SectionId.SCENES_MAIN:
            result = new SectionScenesController();
            break;

        case SectionId.SCENES_DEPLOYED:
            result = new SectionDeployedScenesController();
            break;

        case SectionId.SCENES_PROJECT:
            result = new SectionProjectScenesController();
            break;

        case SectionId.LAND:
            result = new SectionLandController();
            break;

        case SectionId.SETTINGS_PROJECT_GENERAL:
            result = new SectionSceneGeneralSettingsController();
            break;

        case SectionId.SETTINGS_PROJECT_CONTRIBUTORS:
            result = new SectionSceneContributorsSettingsController();
            break;

        case SectionId.SETTINGS_PROJECT_ADMIN:
            result = new SectionSceneAdminsSettingsController();
            break;
        }

        return(result);
    }