slide switch highlighting

This commit is contained in:
Bane Stojkovic
2025-03-16 23:22:34 +01:00
parent 896a623c7c
commit a86af6384b
10 changed files with 252 additions and 179 deletions
@@ -5,7 +5,7 @@ import org.junit.Test;
import org.diylc.components.electromechanical.SlideSwitch;
import org.diylc.components.electromechanical.SlideSwitchType;
public abstract class SlideSwitchTests extends AbstractSwitchTests {
public class SlideSwitchTests extends AbstractSwitchTests {
@Test
public void testSlideSwitchSPDT() {
@@ -19,7 +19,10 @@ public abstract class SlideSwitchTests extends AbstractSwitchTests {
public void testSlideSwitchDPDT() {
SlideSwitch slideSwitch = new SlideSwitch();
slideSwitch.setValue(SlideSwitchType.DPDT);
String[] validCombinations = new String[] {"0,0,2", "0,1,3", "1,2,4", "1,3,5"};
String[] validCombinations = new String[] {
"0,0,1", "0,3,4", // Position 1 connections
"1,1,2", "1,4,5" // Position 2 connections
};
testSwitch(slideSwitch, validCombinations);
}
@@ -27,7 +30,11 @@ public abstract class SlideSwitchTests extends AbstractSwitchTests {
public void testSlideSwitchDP3T() {
SlideSwitch slideSwitch = new SlideSwitch();
slideSwitch.setValue(SlideSwitchType.DP3T);
String[] validCombinations = new String[] {"0,0,2", "0,1,3", "1,2,4", "1,3,5", "2,4,6", "2,5,7"};
String[] validCombinations = new String[] {
"0,0,1", "0,4,5", // Position 1 connections
"1,1,2", "1,5,6", // Position 2 connections
"2,2,3", "2,6,7" // Position 3 connections
};
testSwitch(slideSwitch, validCombinations);
}
}