226 lines
4.7 KiB
Java
226 lines
4.7 KiB
Java
package jmri.jmrix.debugthrottle;
|
|
|
|
import jmri.*;
|
|
import jmri.jmrix.internal.InternalSystemConnectionMemo;
|
|
import jmri.util.JUnitUtil;
|
|
import jmri.util.junit.annotations.NotApplicable;
|
|
|
|
import org.junit.jupiter.api.*;
|
|
|
|
import static org.junit.jupiter.api.Assertions.*;
|
|
|
|
/**
|
|
*
|
|
* @author Paul Bender Copyright (C) 2017
|
|
*/
|
|
public class DebugThrottleTest extends jmri.jmrix.AbstractThrottleTest {
|
|
|
|
@Test
|
|
public void testCTor() {
|
|
assertNotNull( instance, "exists");
|
|
}
|
|
|
|
/**
|
|
* Test of getSpeedIncrement method, of class AbstractThrottle.
|
|
*/
|
|
@Override
|
|
@Test
|
|
public void testGetSpeedIncrement() {
|
|
float expResult = 1.0F/126.0F;
|
|
assertEquals( expResult, instance.getSpeedIncrement(), 0.001);
|
|
}
|
|
|
|
/**
|
|
* Test of getIsForward method, of class AbstractThrottle.
|
|
*/
|
|
@Test
|
|
@Override
|
|
public void testGetIsForward() {
|
|
assertEquals( true, instance.getIsForward());
|
|
}
|
|
|
|
/**
|
|
* Test of getSpeedStepMode method, of class AbstractThrottle.
|
|
*/
|
|
@Test
|
|
@Override
|
|
public void testGetSpeedStepMode() {
|
|
assertEquals( SpeedStepMode.NMRA_DCC_128, instance.getSpeedStepMode());
|
|
}
|
|
|
|
/**
|
|
* Test of setF0 method, of class AbstractThrottle.
|
|
*/
|
|
@Test
|
|
@Override
|
|
public void testSetF0() {
|
|
boolean f0 = false;
|
|
instance.setF0(f0);
|
|
}
|
|
|
|
/**
|
|
* Test of setF1 method, of class AbstractThrottle.
|
|
*/
|
|
@Test
|
|
@Override
|
|
public void testSetF1() {
|
|
boolean f1 = false;
|
|
instance.setF1(f1);
|
|
}
|
|
|
|
/**
|
|
* Test of setF2 method, of class AbstractThrottle.
|
|
*/
|
|
@Test
|
|
@Override
|
|
public void testSetF2() {
|
|
boolean f2 = false;
|
|
instance.setF2(f2);
|
|
}
|
|
|
|
/**
|
|
* Test of setF3 method, of class AbstractThrottle.
|
|
*/
|
|
@Test
|
|
@Override
|
|
public void testSetF3() {
|
|
boolean f3 = false;
|
|
instance.setF3(f3);
|
|
}
|
|
|
|
/**
|
|
* Test of setF4 method, of class AbstractThrottle.
|
|
*/
|
|
@Test
|
|
@Override
|
|
public void testSetF4() {
|
|
boolean f4 = false;
|
|
instance.setF4(f4);
|
|
}
|
|
|
|
/**
|
|
* Test of setF5 method, of class AbstractThrottle.
|
|
*/
|
|
@Test
|
|
@Override
|
|
public void testSetF5() {
|
|
boolean f5 = false;
|
|
instance.setF5(f5);
|
|
}
|
|
|
|
/**
|
|
* Test of setF6 method, of class AbstractThrottle.
|
|
*/
|
|
@Test
|
|
@Override
|
|
public void testSetF6() {
|
|
boolean f6 = false;
|
|
instance.setF6(f6);
|
|
}
|
|
|
|
/**
|
|
* Test of setF7 method, of class AbstractThrottle.
|
|
*/
|
|
@Test
|
|
@Override
|
|
public void testSetF7() {
|
|
boolean f7 = false;
|
|
instance.setF7(f7);
|
|
}
|
|
|
|
/**
|
|
* Test of setF8 method, of class AbstractThrottle.
|
|
*/
|
|
@Test
|
|
@Override
|
|
public void testSetF8() {
|
|
boolean f8 = false;
|
|
instance.setF8(f8);
|
|
}
|
|
|
|
/**
|
|
* Test of setF9 method, of class AbstractThrottle.
|
|
*/
|
|
@Test
|
|
@Override
|
|
public void testSetF9() {
|
|
boolean f9 = false;
|
|
instance.setF9(f9);
|
|
}
|
|
|
|
/**
|
|
* Test of setF10 method, of class AbstractThrottle.
|
|
*/
|
|
@Test
|
|
@Override
|
|
public void testSetF10() {
|
|
boolean f10 = false;
|
|
instance.setF10(f10);
|
|
}
|
|
|
|
/**
|
|
* Test of setF11 method, of class AbstractThrottle.
|
|
*/
|
|
@Test
|
|
@Override
|
|
public void testSetF11() {
|
|
boolean f11 = false;
|
|
instance.setF11(f11);
|
|
}
|
|
|
|
/**
|
|
* Test of setF12 method, of class AbstractThrottle.
|
|
*/
|
|
@Test
|
|
@Override
|
|
public void testSetF12() {
|
|
boolean f12 = false;
|
|
instance.setF12(f12);
|
|
}
|
|
|
|
/**
|
|
* Test of sendFunctionGroup1 method, of class AbstractThrottle.
|
|
*/
|
|
@Test
|
|
@Override
|
|
@NotApplicable("DebugThrottle does not send Functions")
|
|
public void testSendFunctionGroup1() {
|
|
}
|
|
|
|
/**
|
|
* Test of sendFunctionGroup2 method, of class AbstractThrottle.
|
|
*/
|
|
@Test
|
|
@Override
|
|
@NotApplicable("DebugThrottle does not send Functions")
|
|
public void testSendFunctionGroup2() {
|
|
}
|
|
|
|
/**
|
|
* Test of sendFunctionGroup3 method, of class AbstractThrottle.
|
|
*/
|
|
@Test
|
|
@Override
|
|
@NotApplicable("DebugThrottle does not send Functions")
|
|
public void testSendFunctionGroup3() {
|
|
}
|
|
|
|
@BeforeEach
|
|
@Override
|
|
public void setUp() {
|
|
JUnitUtil.setUp();
|
|
var memo = InstanceManager.getDefault(InternalSystemConnectionMemo.class);
|
|
JUnitUtil.initDebugThrottleManager(memo);
|
|
instance = new DebugThrottle(new DccLocoAddress(100,true),memo);
|
|
}
|
|
|
|
@AfterEach
|
|
@Override
|
|
public void tearDown() {
|
|
JUnitUtil.tearDown();
|
|
}
|
|
|
|
// private static final Logger log = LoggerFactory.getLogger(DebugThrottleTest.class);
|
|
|
|
}
|