|
16 | 16 |
|
17 | 17 | import static org.junit.Assert.assertEquals;
|
18 | 18 | import static org.mockito.ArgumentMatchers.any;
|
| 19 | +import static org.mockito.ArgumentMatchers.anyString; |
19 | 20 | import static org.mockito.ArgumentMatchers.eq;
|
20 | 21 | import static org.mockito.Mockito.doReturn;
|
21 | 22 | import static org.mockito.Mockito.spy;
|
@@ -234,4 +235,33 @@ public void testGetUnsyncedSettings() {
|
234 | 235 | Assert.assertEquals("testUnsyncedKey", settings.get(0).getKey());
|
235 | 236 | Assert.assertEquals("testUnsyncedValue", settings.get(0).getValue());
|
236 | 237 | }
|
| 238 | + |
| 239 | + @Test |
| 240 | + public void testGetPreferences() { |
| 241 | + assertEquals(allSharedPreferences, allSettings.getPreferences()); |
| 242 | + } |
| 243 | + |
| 244 | + @Test |
| 245 | + public void testFetchRegisteredANMShouldReturnCorrectProvider() { |
| 246 | + doReturn("provider").when(allSharedPreferences).fetchRegisteredANM(); |
| 247 | + assertEquals("provider", allSettings.fetchRegisteredANM()); |
| 248 | + } |
| 249 | + |
| 250 | + @Test |
| 251 | + public void testFetchDefaultTeamIdShouldReturnCorrectTeamId() { |
| 252 | + doReturn("team-id").when(allSharedPreferences).fetchDefaultTeamId(anyString()); |
| 253 | + assertEquals("team-id", allSettings.fetchDefaultTeamId("user-name")); |
| 254 | + } |
| 255 | + |
| 256 | + @Test |
| 257 | + public void testFetchDefaultTeamShouldReturnCorrectTeam() { |
| 258 | + doReturn("team").when(allSharedPreferences).fetchDefaultTeam(anyString()); |
| 259 | + assertEquals("team", allSettings.fetchDefaultTeam("user-name")); |
| 260 | + } |
| 261 | + |
| 262 | + @Test |
| 263 | + public void testFetchDefaultLocalityIdShouldReturnCorrectLocalityId() { |
| 264 | + doReturn("locality").when(allSharedPreferences).fetchDefaultLocalityId(anyString()); |
| 265 | + assertEquals("locality", allSettings.fetchDefaultLocalityId("user-name")); |
| 266 | + } |
237 | 267 | }
|
0 commit comments