-
-
Notifications
You must be signed in to change notification settings - Fork 770
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
StatusPollTimer can now properly set the update interval
- Loading branch information
Showing
3 changed files
with
28 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
ugs-core/test/com/willwinder/universalgcodesender/StatusPollTimerTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package com.willwinder.universalgcodesender; | ||
|
||
import static org.junit.Assert.assertEquals; | ||
import org.junit.Before; | ||
import org.junit.Test; | ||
import org.mockito.Mock; | ||
import org.mockito.MockitoAnnotations; | ||
|
||
public class StatusPollTimerTest { | ||
private StatusPollTimer statusPollTimer; | ||
|
||
@Mock | ||
private IController controller; | ||
|
||
@Before | ||
public void setUp() { | ||
MockitoAnnotations.initMocks(this); | ||
statusPollTimer = new StatusPollTimer(controller); | ||
} | ||
|
||
@Test | ||
public void setUpdateIntervalShouldSetTheIntervalWhenTimerIsNotRunning() { | ||
statusPollTimer.setUpdateInterval(100); | ||
assertEquals(100, statusPollTimer.getUpdateInterval()); | ||
} | ||
} |