Introduce ExecutionTimeSubject

This commit is contained in:
2025-05-26 15:32:36 +02:00
parent 06e9348016
commit 85bc6e9eba
14 changed files with 131 additions and 40 deletions

View File

@ -27,7 +27,7 @@ class CommandsTests {
EEPROMInterface eepromMock = mock(EEPROMInterface.class);
picComponents.registerComponent(EEPROMInterface.class, eepromMock);
CommandInterface commands = new Commands();
Commands commands = new Commands();
picComponents.registerComponent(CommandInterface.class, commands);
picComponents.initAll();
@ -47,7 +47,7 @@ class CommandsTests {
EEPROMInterface eepromMock = mock(EEPROMInterface.class);
picComponents.registerComponent(EEPROMInterface.class, eepromMock);
CommandInterface commands = new Commands();
Commands commands = new Commands();
picComponents.registerComponent(CommandInterface.class, commands);
picComponents.initAll();
@ -68,7 +68,7 @@ class CommandsTests {
EEPROMInterface eepromMock = mock(EEPROMInterface.class);
picComponents.registerComponent(EEPROMInterface.class, eepromMock);
CommandInterface commands = new Commands();
Commands commands = new Commands();
picComponents.registerComponent(CommandInterface.class, commands);
picComponents.initAll();

View File

@ -69,8 +69,8 @@ class EEPROMTests {
DataRegisterInterface mockDataRegister = Mockito.mock(DataRegisterInterface.class);
picComponents.registerComponent(DataRegisterInterface.class, mockDataRegister);
CommandInterface mockCommands = mock(CommandInterface.class);
picComponents.registerComponent(CommandInterface.class, mockCommands);
ExecutionTimeSubject mockExecutionTime = mock(ExecutionTimeSubject.class);
picComponents.registerComponent(ExecutionTimeSubject.class, mockExecutionTime);
EEPROMInterface eeprom = new EEPROM();
picComponents.registerComponent(EEPROMInterface.class, eeprom);

View File

@ -29,13 +29,13 @@ class WatchDogTimerTests {
picComponents.registerComponent(PreScalerInterface.class, mockPreScaler);
CommandInterface mockCommands = mock(CommandInterface.class);
ExecutionTimeSubject mockExecutionTime = mock(ExecutionTimeSubject.class);
when(
mockCommands.getExecutionTimeMultiplier()
mockExecutionTime.getExecutionTimeMultiplier()
).thenReturn(
1.0
);
picComponents.registerComponent(CommandInterface.class, mockCommands);
picComponents.registerComponent(ExecutionTimeSubject.class, mockExecutionTime);
WatchdogTimerInterface watchDogTimer = new WatchdogTimer();
picComponents.registerComponent(WatchdogTimerInterface.class, watchDogTimer);