mirror of
https://github.com/bancika/diy-layout-creator
synced 2026-11-11 01:32:08 +10:00
Added two DPDT ON/ON/ON variations to 'Mini Toggle Switch' component
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user