use of jmri.UserPreferencesManager in project JMRI by JMRI.
the class JmriUserPreferencesManagerTest method testGetChoiceOptions.
@Test
public void testGetChoiceOptions() {
UserPreferencesManager m = new JmriUserPreferencesManager();
m.setSaveAllowed(false);
HashMap<Integer, String> options = new HashMap<>();
options.put(1, "test1");
Assert.assertTrue(m.getChoiceOptions(strClass, "item1").isEmpty());
m.setMessageItemDetails(strClass, "item1", "description1", options, 0);
Assert.assertEquals(options, m.getChoiceOptions(strClass, "item1"));
}
use of jmri.UserPreferencesManager in project JMRI by JMRI.
the class JmriUserPreferencesManagerTest method testSetSessionPreferenceState.
@Test
public void testSetSessionPreferenceState() {
UserPreferencesManager m = new JmriUserPreferencesManager();
m.setSaveAllowed(false);
Assert.assertFalse(m.getSessionPreferenceState("test1"));
Assert.assertFalse(m.getSessionPreferenceState("test2"));
m.setSessionPreferenceState("test1", true);
Assert.assertTrue(m.getSessionPreferenceState("test1"));
Assert.assertFalse(m.getSessionPreferenceState("test2"));
m.setSessionPreferenceState("test1", false);
Assert.assertFalse(m.getSessionPreferenceState("test1"));
Assert.assertFalse(m.getSessionPreferenceState("test2"));
m.setSessionPreferenceState("test2", true);
Assert.assertFalse(m.getSessionPreferenceState("test1"));
Assert.assertTrue(m.getSessionPreferenceState("test2"));
}
Aggregations