-
Notifications
You must be signed in to change notification settings - Fork 205
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug(persistedUser) warning would not show when persisted user file is…
… not loaded
- Loading branch information
1 parent
fa51e42
commit cb5022d
Showing
4 changed files
with
14 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -136,7 +136,7 @@ internal class UserStoreTest { | |
/** | ||
* If persistUser is false a user is still returned | ||
*/ | ||
@Test | ||
@Test(expected = Exception::class) | ||
fun loadWithoutPersistUser() { | ||
val store = UserStore( | ||
generateConfig(false), | ||
|
@@ -145,21 +145,18 @@ internal class UserStoreTest { | |
prefMigrator, | ||
NoopLogger | ||
) | ||
val user = store.load(User()).user | ||
assertEquals("device-id-123", user.id) | ||
assertNull(user.email) | ||
assertNull(user.name) | ||
assertEquals("", file.readText()) | ||
store.load(User()).user | ||
file.readText() | ||
} | ||
|
||
/** | ||
* If persistUser is false a user is not saved | ||
*/ | ||
@Test | ||
@Test(expected = Exception::class) | ||
fun saveWithoutPersistUser() { | ||
val store = UserStore(generateConfig(false), "", file, prefMigrator, NoopLogger) | ||
store.save(User("123", "[email protected]", "Joe Bloggs")) | ||
assertEquals("", file.readText()) | ||
file.readText() | ||
} | ||
|
||
/** | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters