Added two DPDT ON/ON/ON variations to 'Mini Toggle Switch' component

This commit is contained in:
Bane Stojkovic
2022-08-27 18:10:49 +02:00
parent f5498714b0
commit f2dc63e7e6
5 changed files with 63 additions and 6 deletions
@@ -3,8 +3,10 @@ package org.diylc.netlist;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.fail;
import java.util.Arrays;
import org.diylc.components.electromechanical.MiniToggleSwitch;
import org.diylc.components.electromechanical.SlideSwitch;
import org.diylc.components.electromechanical.SlideSwitchType;
import org.diylc.components.electromechanical.ToggleSwitchType;
import org.diylc.components.guitar.LPSwitch;
import org.diylc.components.guitar.LeverSwitch;
import org.diylc.components.guitar.LeverSwitch.LeverSwitchType;
@@ -66,6 +68,22 @@ public class SwitchTests {
String[] validCombinations = new String[] {"0,0,2", "0,1,3", "1,2,4", "1,3,5", "2,4,6", "2,5,7"};
testSwitch(slideSwitch, validCombinations);
}
@Test
public void testMiniToggleSwitchDPDTononon1() {
MiniToggleSwitch toggleSwitch = new MiniToggleSwitch();
toggleSwitch.setValue(ToggleSwitchType.DPDT_ononon_1);
String[] validCombinations = new String[] {"0,0,1", "0,3,4", "1,0,1", "1,4,5", "2,1,2", "2,4,5"};
testSwitch(toggleSwitch, validCombinations);
}
@Test
public void testMiniToggleSwitchDPDTononon2() {
MiniToggleSwitch toggleSwitch = new MiniToggleSwitch();
toggleSwitch.setValue(ToggleSwitchType.DPDT_ononon_2);
String[] validCombinations = new String[] {"0,0,1", "0,3,4", "1,1,2", "1,3,4", "2,1,2", "2,4,5"};
testSwitch(toggleSwitch, validCombinations);
}
private void testSwitch(ISwitch sw, String[] validCombinations) {
Arrays.sort(validCombinations);