예제 #1
0
        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);
        }
예제 #2
0
    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);
예제 #3
0
    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);