Island: Add tests for IslandModeService

This commit is contained in:
Mike Salvatore 2022-07-01 11:38:20 -04:00
parent 8f7e7f98e7
commit 4a91777019
1 changed files with 16 additions and 0 deletions

View File

@ -0,0 +1,16 @@
import pytest
from tests.monkey_island import InMemorySimulationRepository
from monkey_island.cc.services import IslandModeService
from monkey_island.cc.services.mode.mode_enum import IslandModeEnum
@pytest.fixture
def island_mode_service():
return IslandModeService(InMemorySimulationRepository())
@pytest.mark.parametrize("mode", list(IslandModeEnum))
def test_set_mode(island_mode_service, mode):
island_mode_service.set_mode(mode)
assert island_mode_service.get_mode() == mode