< Summary

Class:Tests.BuildModeHUDControllers.BuildModeHUDControllerShould
Assembly:BuildModeHUDTests
File(s):/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/HUD/BuildModeHUD/Tests/BuildModeHUDControllerShould.cs
Covered lines:219
Uncovered lines:1
Coverable lines:220
Total lines:598
Line coverage:99.5% (219 of 220)
Covered branches:0
Total branches:0

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
SetUp()0%220100%
TearDown()0%110100%
CreateBuildModeControllersCorrectly()0%110100%
CreateMainViewCorrectly()0%110100%
SetBuilderProjectInfoCorrectly(...)0%220100%
StartNewProjectFlowCorrectly()0%110100%
ConfirmNewProjectDetailsCorrectly()0%110100%
CancelNewProjectDetailsCorrectly()0%110100%
PublishStartCorrectly()0%110100%
ConfirmPublicationDetailsCorrectly()0%110100%
CancelPublicationDetailsCorrectly()0%110100%
CancelPublishModalCorrectly()0%110100%
ConfirmPublishModalCorrectly()0%110100%
ExitStartCorrectly()0%110100%
CancelExitModalCorrectly()0%110100%
ConfirmExitModalCorrectly()0%110100%
PublishEndCorrectly(...)0%110100%
SetParcelSceneCorrectly()0%110100%
SetPublishBtnAvailabilityCorrectly(...)0%110100%
RefreshCatalogAssetPackCorrectly()0%110100%
RefreshCatalogContentCorrectly()0%110100%
CatalogItemSelectedCorrectly()0%110100%
SetVisibilityOfCatalogCorrectly(...)0%220100%
ChangeVisibilityOfCatalogCorrectly()0%110100%
UpdateSceneLimitInfoCorrectly()0%110100%
ChangeVisibilityOfSceneInfoCorrectly(...)0%110100%
ChangeVisibilityOfSceneInfoCorrectly()0%110100%
ActivateFirstPersonModeUICorrectly()0%110100%
ActivateGodModeUICorrectly()0%110100%
EntityInformationSetEntityCorrectly()0%110100%
ShowEntityInformationCorrectly(...)0%220100%
HideEntityInformationCorrectly()0%2.022083.33%
SetEntityListCorrectly()0%110100%
ChangeVisibilityOfEntityListCorrectly(...)0%220100%
ClearEntityListCorrectly()0%110100%
ChangeVisibilityOfControlsCorrectly()0%110100%
ChangeVisibilityOfExtraBtnsCorrectly()0%110100%
SetVisibilityOfInspectorCorrectly(...)0%110100%
ConfigureConfirmationModalCorrectly()0%110100%

File(s)

/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/HUD/BuildModeHUD/Tests/BuildModeHUDControllerShould.cs

#LineLine coverage
 1using DCL.Controllers;
 2using NSubstitute;
 3using NSubstitute.Extensions;
 4using NUnit.Framework;
 5using System.Collections.Generic;
 6using UnityEngine;
 7
 8namespace Tests.BuildModeHUDControllers
 9{
 10    public class BuildModeHUDControllerShould
 11    {
 12        private BuildModeHUDController buildModeHUDController;
 13
 14        [SetUp]
 15        public void SetUp()
 16        {
 4517            BuildModeHUDInitializationModel testControllers = new BuildModeHUDInitializationModel
 18            {
 19                tooltipController = Substitute.For<ITooltipController>(),
 20                sceneCatalogController = Substitute.For<ISceneCatalogController>(),
 21                quickBarController = Substitute.For<IQuickBarController>(),
 22                entityInformationController = Substitute.For<IEntityInformationController>(),
 23                firstPersonModeController = Substitute.For<IFirstPersonModeController>(),
 24                shortcutsController = Substitute.For<IShortcutsController>(),
 25                publishPopupController = Substitute.For<IPublishPopupController>(),
 26                dragAndDropSceneObjectController = Substitute.For<IDragAndDropSceneObjectController>(),
 27                publishBtnController = Substitute.For<IPublishBtnController>(),
 28                inspectorBtnController = Substitute.For<IInspectorBtnController>(),
 29                catalogBtnController = Substitute.For<ICatalogBtnController>(),
 30                inspectorController = Substitute.For<IInspectorController>(),
 31                buildModeConfirmationModalController = Substitute.For<IBuildModeConfirmationModalController>(),
 32                topActionsButtonsController = Substitute.For<ITopActionsButtonsController>(),
 33                saveHUDController = Substitute.For<ISaveHUDController>(),
 34                newProjectDetailsController = Substitute.For<IPublicationDetailsController>(),
 35                publicationDetailsController = Substitute.For<IPublicationDetailsController>()
 36            };
 37
 4538            buildModeHUDController = Substitute.ForPartsOf<BuildModeHUDController>();
 9139            buildModeHUDController.Configure().CreateView().Returns(info => Substitute.For<IBuildModeHUDView>());
 4540            buildModeHUDController.Initialize(testControllers);
 4541        }
 42
 43        [TearDown]
 4544        public void TearDown() { }
 45
 46        [Test]
 47        public void CreateBuildModeControllersCorrectly()
 48        {
 49            // Arrange
 150            buildModeHUDController.controllers.tooltipController = null;
 151            buildModeHUDController.controllers.sceneCatalogController = null;
 152            buildModeHUDController.controllers.quickBarController = null;
 153            buildModeHUDController.controllers.entityInformationController = null;
 154            buildModeHUDController.controllers.firstPersonModeController = null;
 155            buildModeHUDController.controllers.shortcutsController = null;
 156            buildModeHUDController.controllers.publishPopupController = null;
 157            buildModeHUDController.controllers.dragAndDropSceneObjectController = null;
 158            buildModeHUDController.controllers.publishBtnController = null;
 159            buildModeHUDController.controllers.inspectorBtnController = null;
 160            buildModeHUDController.controllers.catalogBtnController = null;
 161            buildModeHUDController.controllers.inspectorController = null;
 162            buildModeHUDController.controllers.topActionsButtonsController = null;
 163            buildModeHUDController.controllers.saveHUDController = null;
 164            buildModeHUDController.controllers.newProjectDetailsController = null;
 165            buildModeHUDController.controllers.publicationDetailsController = null;
 66
 67            // Act
 168            buildModeHUDController.CreateBuildModeControllers();
 69
 70            // Assert
 171            Assert.NotNull(buildModeHUDController.controllers.tooltipController, "The tooltipController is null!");
 172            Assert.NotNull(buildModeHUDController.controllers.sceneCatalogController, "The sceneCatalogController is nul
 173            Assert.NotNull(buildModeHUDController.controllers.quickBarController, "The quickBarController is null!");
 174            Assert.NotNull(buildModeHUDController.controllers.entityInformationController, "The entityInformationControl
 175            Assert.NotNull(buildModeHUDController.controllers.firstPersonModeController, "The firstPersonModeController 
 176            Assert.NotNull(buildModeHUDController.controllers.shortcutsController, "The shortcutsController is null!");
 177            Assert.NotNull(buildModeHUDController.controllers.publishPopupController, "The publishPopupController is nul
 178            Assert.NotNull(buildModeHUDController.controllers.dragAndDropSceneObjectController, "The dragAndDropSceneObj
 179            Assert.NotNull(buildModeHUDController.controllers.publishBtnController, "The publishBtnController is null!")
 180            Assert.NotNull(buildModeHUDController.controllers.inspectorBtnController, "The inspectorBtnController is nul
 181            Assert.NotNull(buildModeHUDController.controllers.catalogBtnController, "The catalogBtnController is null!")
 182            Assert.NotNull(buildModeHUDController.controllers.inspectorController, "The inspectorController is null!");
 183            Assert.NotNull(buildModeHUDController.controllers.topActionsButtonsController, "The topActionsButtonsControl
 184            Assert.NotNull(buildModeHUDController.controllers.saveHUDController, "The saveHUDController is null!");
 185            Assert.NotNull(buildModeHUDController.controllers.newProjectDetailsController, "The newProjectDetailsControl
 186            Assert.NotNull(buildModeHUDController.controllers.publicationDetailsController, "The publicationDetailsContr
 187        }
 88
 89        [Test]
 90        public void CreateMainViewCorrectly()
 91        {
 92            // Arrange
 193            buildModeHUDController.view = null;
 94
 95            // Act
 196            buildModeHUDController.CreateMainView();
 97
 98            // Assert
 199            Assert.NotNull(buildModeHUDController.view, "The view is null!");
 1100            buildModeHUDController.view.Received(1).Initialize(buildModeHUDController.controllers);
 1101        }
 102
 103        [Test]
 104        [TestCase("")]
 105        [TestCase("Test name")]
 106        public void SetBuilderProjectInfoCorrectly(string projectName)
 107        {
 108            // Arrange
 2109            string testDesc = "Test name";
 110
 111            // Act
 2112            buildModeHUDController.SetBuilderProjectInfo(projectName, testDesc);
 113
 114            // Assert
 2115            if (!string.IsNullOrEmpty(projectName))
 116            {
 1117                buildModeHUDController.controllers.newProjectDetailsController.Received(1).SetCustomPublicationInfo(proj
 1118                buildModeHUDController.controllers.publicationDetailsController.Received(1).SetCustomPublicationInfo(pro
 1119            }
 120            else
 121            {
 1122                buildModeHUDController.controllers.newProjectDetailsController.Received(1).SetDefaultPublicationInfo();
 1123                buildModeHUDController.controllers.publicationDetailsController.Received(1).SetDefaultPublicationInfo();
 124            }
 1125        }
 126
 127        [Test]
 128        public void StartNewProjectFlowCorrectly()
 129        {
 130            // Arrange
 1131            Texture2D testScreenshot = new Texture2D(10, 10);
 132
 133            // Act
 1134            buildModeHUDController.NewProjectStart(testScreenshot);
 135
 136            // Assert
 1137            buildModeHUDController.controllers.newProjectDetailsController.Received(1).SetPublicationScreenshot(testScre
 138
 139            // TODO: This is temporal until we add the Welcome panel where the user will be able to edit the project inf
 140            //buildModeHUDController.controllers.newProjectDetailsController.Received(1).SetActive(true);
 1141        }
 142
 143        [Test]
 144        public void ConfirmNewProjectDetailsCorrectly()
 145        {
 146            // Arrange
 1147            bool newProjectDetailsConfirmed = false;
 1148            buildModeHUDController.OnSaveSceneInfoAction += (name, desc, image) =>
 149            {
 1150                newProjectDetailsConfirmed = true;
 1151            };
 152
 153            // Act
 1154            buildModeHUDController.SaveSceneInfo();
 155
 156            // Assert
 1157            buildModeHUDController.controllers.newProjectDetailsController.Received(1).GetSceneScreenshotTexture();
 1158            buildModeHUDController.controllers.newProjectDetailsController.Received(1).GetSceneName();
 1159            buildModeHUDController.controllers.newProjectDetailsController.Received(1).GetSceneDescription();
 1160            buildModeHUDController.controllers.publicationDetailsController.Received(1).SetCustomPublicationInfo(Arg.Any
 1161            buildModeHUDController.controllers.newProjectDetailsController.Received(1).SetActive(false);
 1162            Assert.IsTrue(newProjectDetailsConfirmed);
 1163        }
 164
 165        [Test]
 166        public void CancelNewProjectDetailsCorrectly()
 167        {
 168            // Act
 1169            buildModeHUDController.CancelNewProjectDetails();
 170
 171            // Assert
 1172            buildModeHUDController.controllers.newProjectDetailsController.Received(1).SetActive(false);
 1173        }
 174
 175        [Test]
 176        public void PublishStartCorrectly()
 177        {
 178            // Act
 1179            buildModeHUDController.PublishStart();
 180
 181            // Assert
 1182            buildModeHUDController.controllers.publicationDetailsController.Received(1).SetActive(true);
 1183        }
 184
 185        [Test]
 186        public void ConfirmPublicationDetailsCorrectly()
 187        {
 188            // Act
 1189            buildModeHUDController.ConfirmPublicationDetails();
 190
 191            // Assert
 1192            buildModeHUDController.controllers.buildModeConfirmationModalController.Received(1)
 193                                  .Configure(
 194                                      Arg.Any<string>(),
 195                                      Arg.Any<string>(),
 196                                      Arg.Any<string>(),
 197                                      Arg.Any<string>());
 1198            buildModeHUDController.controllers.buildModeConfirmationModalController.Received(1).SetActive(true, BuildMod
 1199        }
 200
 201        [Test]
 202        public void CancelPublicationDetailsCorrectly()
 203        {
 204            // Act
 1205            buildModeHUDController.CancelPublishModal(BuildModeModalType.PUBLISH);
 206
 207            // Assert
 1208            buildModeHUDController.controllers.buildModeConfirmationModalController.Received(1).SetActive(false, BuildMo
 1209            buildModeHUDController.controllers.publicationDetailsController.Received(1).SetActive(true);
 1210        }
 211
 212        [Test]
 213        public void CancelPublishModalCorrectly()
 214        {
 215            // Act
 1216            buildModeHUDController.CancelPublicationDetails();
 217
 218            // Assert
 1219            buildModeHUDController.controllers.publicationDetailsController.Received(1).SetActive(false);
 1220        }
 221
 222        [Test]
 223        public void ConfirmPublishModalCorrectly()
 224        {
 225            // Arrange
 1226            bool publishConfirmed = false;
 3227            buildModeHUDController.OnConfirmPublishAction += (sceneName, sceneDesc, sceneScreenshot) => { publishConfirm
 228
 229            // Act
 1230            buildModeHUDController.ConfirmPublishModal(BuildModeModalType.PUBLISH);
 231
 232            // Assert
 1233            buildModeHUDController.controllers.publishPopupController.Received(1).PublishStart();
 1234            Assert.IsTrue(publishConfirmed, "publishConfirmed is false!");
 1235        }
 236
 237        [Test]
 238        public void ExitStartCorrectly()
 239        {
 240            // Act
 1241            buildModeHUDController.ExitStart();
 242
 243            // Assert
 1244            buildModeHUDController.controllers.buildModeConfirmationModalController.Received(1).SetActive(true, BuildMod
 1245        }
 246
 247        [Test]
 248        public void CancelExitModalCorrectly()
 249        {
 250            // Act
 1251            buildModeHUDController.CancelExitModal(BuildModeModalType.EXIT);
 252
 253            // Assert
 1254            buildModeHUDController.controllers.buildModeConfirmationModalController.Received(1).SetActive(false, BuildMo
 1255        }
 256
 257        [Test]
 258        public void ConfirmExitModalCorrectly()
 259        {
 260            // Arrange
 1261            bool exitConfirmed = false;
 3262            buildModeHUDController.OnLogoutAction += () => { exitConfirmed = true; };
 263
 264            // Act
 1265            buildModeHUDController.ConfirmExitModal(BuildModeModalType.EXIT);
 266
 267            // Assert
 1268            Assert.IsTrue(exitConfirmed, "exitConfirmed is false!");
 1269            buildModeHUDController.controllers.publicationDetailsController.Received().SetDefaultPublicationInfo();
 1270        }
 271
 272        [Test]
 273        [TestCase(true)]
 274        [TestCase(false)]
 275        public void PublishEndCorrectly(bool isOk)
 276        {
 277            // Arrange
 2278            string testErrorMessage = "Test text";
 279
 280            // Act
 2281            buildModeHUDController.PublishEnd(isOk, testErrorMessage);
 282
 283            // Assert
 2284            buildModeHUDController.controllers.publishPopupController.Received(1).PublishEnd(isOk, testErrorMessage);
 2285        }
 286
 287        [Test]
 288        public void SetParcelSceneCorrectly()
 289        {
 290            // Arrange
 1291            ParcelScene testParcelScene = new GameObject("_ParcelScene").AddComponent<ParcelScene>();
 292
 293            // Act
 1294            buildModeHUDController.SetParcelScene(testParcelScene);
 295
 296            // Assert
 1297            buildModeHUDController.controllers.inspectorController.sceneLimitsController.Received(1).SetParcelScene(test
 1298        }
 299
 300        [Test]
 301        [TestCase(true)]
 302        [TestCase(false)]
 303        public void SetPublishBtnAvailabilityCorrectly(bool isAvailable)
 304        {
 305            // Act
 2306            buildModeHUDController.SetPublishBtnAvailability(isAvailable);
 307
 308            // Assert
 2309            buildModeHUDController.view.Received(1).SetPublishBtnAvailability(isAvailable);
 2310        }
 311
 312        [Test]
 313        public void RefreshCatalogAssetPackCorrectly()
 314        {
 315            // Act
 1316            buildModeHUDController.RefreshCatalogAssetPack();
 317
 318            // Assert
 1319            buildModeHUDController.view.Received(1).RefreshCatalogAssetPack();
 1320        }
 321
 322        [Test]
 323        public void RefreshCatalogContentCorrectly()
 324        {
 325            // Act
 1326            buildModeHUDController.RefreshCatalogContent();
 327
 328            // Assert
 1329            buildModeHUDController.view.Received(1).RefreshCatalogContent();
 1330        }
 331
 332        [Test]
 333        public void CatalogItemSelectedCorrectly()
 334        {
 335            // Arrange
 1336            CatalogItem returnedCatalogItem = null;
 1337            CatalogItem testCatalogItem = new CatalogItem();
 3338            buildModeHUDController.OnCatalogItemSelected += (item) => { returnedCatalogItem = item; };
 339
 340            // Act
 1341            buildModeHUDController.CatalogItemSelected(testCatalogItem);
 342
 343            // Assert
 1344            Assert.AreEqual(testCatalogItem, returnedCatalogItem, "The catalog item does not march!");
 1345        }
 346
 347        [Test]
 348        [TestCase(true)]
 349        [TestCase(false)]
 350        public void SetVisibilityOfCatalogCorrectly(bool isVisible)
 351        {
 352            // Arrange
 2353            bool catalogOpened = false;
 2354            buildModeHUDController.isCatalogOpen = !isVisible;
 4355            buildModeHUDController.OnCatalogOpen += () => { catalogOpened = true; };
 356
 357            // Act
 2358            buildModeHUDController.SetVisibilityOfCatalog(isVisible);
 359
 360            // Assert
 2361            Assert.AreEqual(isVisible, buildModeHUDController.isCatalogOpen, "The isCatalogOpen does not match!");
 2362            buildModeHUDController.view.Received(1).SetVisibilityOfCatalog(buildModeHUDController.isCatalogOpen);
 363
 2364            if (isVisible)
 1365                Assert.IsTrue(catalogOpened, "catalogOpened is false!");
 2366        }
 367
 368        [Test]
 369        public void ChangeVisibilityOfCatalogCorrectly()
 370        {
 371            // Arrange
 1372            buildModeHUDController.isCatalogOpen = buildModeHUDController.controllers.sceneCatalogController.IsCatalogOp
 373
 374            // Act
 1375            buildModeHUDController.ChangeVisibilityOfCatalog();
 376
 377            // Assert
 1378            Assert.AreEqual(
 379                !buildModeHUDController.controllers.sceneCatalogController.IsCatalogOpen(),
 380                buildModeHUDController.isCatalogOpen,
 381                "The isCatalogOpen does not match!");
 1382        }
 383
 384        [Test]
 385        public void UpdateSceneLimitInfoCorrectly()
 386        {
 387            // Act
 1388            buildModeHUDController.UpdateSceneLimitInfo();
 389
 390            // Assert
 1391            buildModeHUDController.controllers.inspectorController.sceneLimitsController.Received(1).UpdateInfo();
 1392        }
 393
 394        [Test]
 395        [TestCase(true)]
 396        [TestCase(false)]
 397        public void ChangeVisibilityOfSceneInfoCorrectly(bool shouldBeVisible)
 398        {
 399            // Arrange
 2400            buildModeHUDController.isSceneLimitInfoVisibile = !shouldBeVisible;
 401
 402            // Act
 2403            buildModeHUDController.ChangeVisibilityOfSceneInfo(shouldBeVisible);
 404
 405            // Assert
 2406            Assert.AreEqual(shouldBeVisible, buildModeHUDController.isSceneLimitInfoVisibile, "The isSceneLimitInfoVisib
 2407            buildModeHUDController.view.Received(1).SetVisibilityOfSceneInfo(buildModeHUDController.isSceneLimitInfoVisi
 2408        }
 409
 410        [Test]
 411        public void ChangeVisibilityOfSceneInfoCorrectly()
 412        {
 413            // Arrange
 1414            buildModeHUDController.isSceneLimitInfoVisibile = false;
 415
 416            // Act
 1417            buildModeHUDController.ChangeVisibilityOfSceneInfo();
 418
 419            // Assert
 1420            Assert.IsTrue(buildModeHUDController.isSceneLimitInfoVisibile, "The isSceneLimitInfoVisibile is false!");
 1421            buildModeHUDController.view.Received(1).SetVisibilityOfSceneInfo(buildModeHUDController.isSceneLimitInfoVisi
 1422        }
 423
 424        [Test]
 425        public void ActivateFirstPersonModeUICorrectly()
 426        {
 427            // Act
 1428            buildModeHUDController.ActivateFirstPersonModeUI();
 429
 430            // Assert
 1431            buildModeHUDController.view.Received(1).SetFirstPersonView();
 1432        }
 433
 434        [Test]
 435        public void ActivateGodModeUICorrectly()
 436        {
 437            // Act
 1438            buildModeHUDController.ActivateGodModeUI();
 439
 440            // Assert
 1441            buildModeHUDController.view.Received(1).SetGodModeView();
 1442        }
 443
 444        [Test]
 445        public void EntityInformationSetEntityCorrectly()
 446        {
 447            // Arrange
 1448            DCLBuilderInWorldEntity testEntity = new GameObject("_DCLBuilderInWorldEntity").AddComponent<DCLBuilderInWor
 1449            ParcelScene testScene = new GameObject("_ParcelScene").AddComponent<ParcelScene>();
 450
 451            // Act
 1452            buildModeHUDController.EntityInformationSetEntity(testEntity, testScene);
 453
 454            // Assert
 1455            buildModeHUDController.controllers.entityInformationController.Received(1).SetEntity(testEntity, testScene);
 1456        }
 457
 458        [Test]
 459        [TestCase(true)]
 460        [TestCase(false)]
 461        public void ShowEntityInformationCorrectly(bool activateTransparencyMode)
 462        {
 463            // Act
 2464            buildModeHUDController.ShowEntityInformation(activateTransparencyMode);
 465
 466            // Assert
 2467            buildModeHUDController.controllers.entityInformationController.Received(1).Enable();
 2468            buildModeHUDController.controllers.entityInformationController.Received(1).SetTransparencyMode(activateTrans
 2469            buildModeHUDController.controllers.sceneCatalogController.Received(1).CloseCatalog();
 2470            buildModeHUDController.controllers.tooltipController.Received(1).HideTooltip();
 471
 2472            if (activateTransparencyMode)
 1473                buildModeHUDController.controllers.catalogBtnController.Received(1).SetActive(false);
 2474        }
 475
 476        [Test]
 477        public void HideEntityInformationCorrectly()
 478        {
 479            // Act
 1480            buildModeHUDController.HideEntityInformation();
 481
 482            // Assert
 1483            buildModeHUDController.controllers.entityInformationController.Received(1).Disable();
 1484            buildModeHUDController.controllers.catalogBtnController.Received(1).SetActive(true);
 485
 1486            if (buildModeHUDController.isCatalogOpen)
 0487                buildModeHUDController.controllers.sceneCatalogController.Received(1).SetActive(true);
 1488        }
 489
 490        [Test]
 491        public void SetEntityListCorrectly()
 492        {
 493            // Arrange
 1494            List<DCLBuilderInWorldEntity> testEntityList = new List<DCLBuilderInWorldEntity>();
 1495            testEntityList.Add(new GameObject("_DCLBuilderInWorldEntity1").AddComponent<DCLBuilderInWorldEntity>());
 1496            testEntityList.Add(new GameObject("_DCLBuilderInWorldEntity2").AddComponent<DCLBuilderInWorldEntity>());
 1497            testEntityList.Add(new GameObject("_DCLBuilderInWorldEntity3").AddComponent<DCLBuilderInWorldEntity>());
 498
 499            // Act
 1500            buildModeHUDController.SetEntityList(testEntityList);
 501
 502            // Assert
 1503            buildModeHUDController.controllers.inspectorController.Received(1).SetEntityList(testEntityList);
 1504        }
 505
 506        [Test]
 507        [TestCase(true)]
 508        [TestCase(false)]
 509        public void ChangeVisibilityOfEntityListCorrectly(bool isVisible)
 510        {
 511            // Arrange
 2512            bool isEntityListVisible = false;
 2513            buildModeHUDController.isEntityListVisible = isVisible;
 4514            buildModeHUDController.OnEntityListVisible += () => { isEntityListVisible = true; };
 515
 516            // Act
 2517            buildModeHUDController.ChangeVisibilityOfEntityList();
 518
 519            // Assert
 2520            if (buildModeHUDController.isEntityListVisible)
 521            {
 1522                Assert.IsTrue(isEntityListVisible, "isEntityListVisible is false!");
 1523                buildModeHUDController.controllers.inspectorController.Received(1).OpenEntityList();
 1524            }
 525            else
 526            {
 1527                buildModeHUDController.controllers.inspectorController.Received(1).CloseList();
 528            }
 1529        }
 530
 531        [Test]
 532        public void ClearEntityListCorrectly()
 533        {
 534            // Act
 1535            buildModeHUDController.ClearEntityList();
 536
 537            // Assert
 1538            buildModeHUDController.controllers.inspectorController.Received(1).ClearList();
 1539        }
 540
 541        [Test]
 542        public void ChangeVisibilityOfControlsCorrectly()
 543        {
 544            // Arrange
 1545            buildModeHUDController.isControlsVisible = false;
 546
 547            // Act
 1548            buildModeHUDController.ChangeVisibilityOfControls();
 549
 550            // Assert
 1551            Assert.IsTrue(buildModeHUDController.isControlsVisible, "The isControlsVisible is false!");
 1552            buildModeHUDController.view.Received(1).SetVisibilityOfControls(buildModeHUDController.isControlsVisible);
 1553        }
 554
 555        [Test]
 556        public void ChangeVisibilityOfExtraBtnsCorrectly()
 557        {
 558            // Arrange
 1559            buildModeHUDController.areExtraButtonsVisible = false;
 560
 561            // Act
 1562            buildModeHUDController.ChangeVisibilityOfExtraBtns();
 563
 564            // Assert
 1565            Assert.IsTrue(buildModeHUDController.areExtraButtonsVisible, "The areExtraButtonsVisible is false!");
 1566            buildModeHUDController.view.Received(1).SetVisibilityOfExtraBtns(buildModeHUDController.areExtraButtonsVisib
 1567        }
 568
 569        [Test]
 570        [TestCase(true)]
 571        [TestCase(false)]
 572        public void SetVisibilityOfInspectorCorrectly(bool isVisible)
 573        {
 574            // Act
 2575            buildModeHUDController.SetVisibilityOfInspector(isVisible);
 576
 577            // Assert
 2578            Assert.AreEqual(isVisible, buildModeHUDController.isEntityListVisible);
 2579            buildModeHUDController.view.Received(1).SetVisibilityOfInspector(isVisible);
 2580        }
 581
 582        [Test]
 583        public void ConfigureConfirmationModalCorrectly()
 584        {
 585            // Arrange
 1586            string testTitle = "test title";
 1587            string testSubTitle = "test subTitle";
 1588            string testCancelText = "test cancel";
 1589            string testConfirmText = "test confirm";
 590
 591            // Act
 1592            buildModeHUDController.ConfigureConfirmationModal(testTitle, testSubTitle, testCancelText, testConfirmText);
 593
 594            // Assert
 1595            buildModeHUDController.controllers.buildModeConfirmationModalController.Received(1).Configure(testTitle, tes
 1596        }
 597    }
 598}