public void SetupBlockersOnlyWhenEnabled() { blockerController.SetupWorldBlockers(); Assert.IsTrue(blockerHandler.allLoadedParcelCoords.Count == 3); blockerController.SetEnabled(false); Assert.IsTrue(blockerHandler.allLoadedParcelCoords.Count == 0); blockerController.SetupWorldBlockers(); Assert.IsTrue(blockerHandler.allLoadedParcelCoords.Count == 0); blockerController.SetEnabled(true); blockerController.SetupWorldBlockers(); Assert.IsTrue(blockerHandler.allLoadedParcelCoords.Count == 3); }
public void SetupBlockersOnlyWhenEnabled() { // Arrange blockerInstanceHandler = Substitute.For <IBlockerInstanceHandler>(); blockerInstanceHandler.GetBlockers().Returns(new Dictionary <Vector2Int, PoolableObject>()); blockerController = new WorldBlockersController(sceneHandler, blockerInstanceHandler, new DCLCharacterPosition()); // Act-assert #1: first blockers added should be shown blockerController.SetupWorldBlockers(); blockerInstanceHandler.ReceivedWithAnyArgs().ShowBlocker(default);
public void SetupBlockersOnlyWhenEnabled() { // Arrange blockerInstanceHandler = Substitute.For <IBlockerInstanceHandler>(); blockerInstanceHandler.GetBlockers().Returns(new Dictionary <Vector2Int, PoolableObject>()); if (blockerController != null) { blockerController.Dispose(); } blockerController.Initialize(sceneHandler, blockerInstanceHandler); // Act-assert #1: first blockers added should be shown blockerController.SetupWorldBlockers(); blockerInstanceHandler.ReceivedWithAnyArgs().ShowBlocker(default);