Class SettingsManagerTest
java.lang.Object
test.SettingsManagerTest
Provides test cases for the
SettingsManager
class.
Tests the methods for getting and setting the current MeasurementSystem
, ErrorDisplayState
, and
Currency
,
as well as the registration of listeners to be notified when settings change to reflect the changes in the UI.
Contains the following test cases:
-
testDefaultValues()
- Tests the default values of the settings -
testSetAndGetMeasurementSystem()
- Tests the setting and getting of the measurement system -
testSetAndGetErrorDisplayState()
- Tests the setting and getting of the error display state -
testSetAndGetCurrency()
- Tests the setting and getting of the currency -
testListenerNotification()
- Tests the notification of a listener when settings change -
testMultipleListenersNotification()
- Tests the notification of multiple listeners when settings change
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Resets the settings to the default values before each test.void
Tests the default values of the settings.void
Tests the notification of a listener when settings change.void
Tests the notification of multiple listeners when settings change.void
Tests the setting and getting of the currency.void
Tests the setting and getting of the error display state.void
Tests the setting and getting of the measurement system.
-
Constructor Details
-
SettingsManagerTest
public SettingsManagerTest()
-
-
Method Details
-
resetSettings
@BeforeEach public void resetSettings()Resets the settings to the default values before each test. -
testDefaultValues
@Test public void testDefaultValues()Tests the default values of the settings. -
testSetAndGetMeasurementSystem
@Test public void testSetAndGetMeasurementSystem()Tests the setting and getting of the measurement system. -
testSetAndGetErrorDisplayState
@Test public void testSetAndGetErrorDisplayState()Tests the setting and getting of the error display state. -
testSetAndGetCurrency
@Test public void testSetAndGetCurrency()Tests the setting and getting of the currency. -
testListenerNotification
@Test public void testListenerNotification()Tests the notification of a listener when settings change. -
testMultipleListenersNotification
@Test public void testMultipleListenersNotification()Tests the notification of multiple listeners when settings change.
-