use of com.willwinder.universalgcodesender.firmware.GrblFirmwareSettings in project Universal-G-Code-Sender by winder.
the class GrblControllerMockTests method testFillInSettings.
@Test
public void testFillInSettings() {
GrblController gc = Mockito.spy(new GrblController());
GrblFirmwareSettings firmwareSettings = Mockito.mock(GrblFirmwareSettings.class);
Mockito.when(firmwareSettings.getReportingUnits()).thenReturn(Units.MM);
doReturn(firmwareSettings).when(gc).getFirmwareSettings();
String description = "Status report options, mask";
gc.rawResponseListener("$10=100");
ArgumentCaptor<String> consoleMessageCaptor = ArgumentCaptor.forClass(String.class);
verify(gc, times(1)).messageForConsole(consoleMessageCaptor.capture());
assertThat(consoleMessageCaptor.getValue(), containsString(description));
}
use of com.willwinder.universalgcodesender.firmware.GrblFirmwareSettings in project Universal-G-Code-Sender by winder.
the class GrblControllerMockTests method testProbeResponse.
@Test
public void testProbeResponse() {
GrblController gc = Mockito.spy(new GrblController());
GrblFirmwareSettings firmwareSettings = Mockito.mock(GrblFirmwareSettings.class);
Mockito.when(firmwareSettings.getReportingUnits()).thenReturn(Units.MM);
doReturn(firmwareSettings).when(gc).getFirmwareSettings();
gc.rawResponseListener("[PRB:-192.200,-202.000,-40.400:1]");
ArgumentCaptor<Position> probeCaptor = ArgumentCaptor.forClass(Position.class);
verify(gc, times(1)).dispatchProbeCoordinates(probeCaptor.capture());
assertThat(probeCaptor.getValue(), is(new Position(-192.200, -202.000, -40.400, Units.MM)));
}
Aggregations