-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Denis Trotsenko
committed
Jun 28, 2023
1 parent
c9edc58
commit 46bcfe9
Showing
2 changed files
with
33 additions
and
1 deletion.
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
23 changes: 23 additions & 0 deletions
23
kotpass/src/test/kotlin/app/keemobile/kotpass/models/EntryValueSpec.kt
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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package app.keemobile.kotpass.models | ||
|
||
import app.keemobile.kotpass.cryptography.EncryptedValue | ||
import io.kotest.core.spec.style.DescribeSpec | ||
import io.kotest.matchers.shouldBe | ||
|
||
class EntryValueSpec : DescribeSpec({ | ||
|
||
describe("EntryValue") { | ||
it("isEmpty check properly evaluates empty string") { | ||
val emptyPlain = EntryValue.Plain("") | ||
val emptyEncrypted = EntryValue.Encrypted(EncryptedValue.fromString("")) | ||
val somePlain = EntryValue.Encrypted(EncryptedValue.fromString("123")) | ||
val someEncrypted = EntryValue.Encrypted(EncryptedValue.fromString("123")) | ||
|
||
emptyPlain.isEmpty() shouldBe true | ||
emptyEncrypted.isEmpty() shouldBe true | ||
|
||
somePlain.isEmpty() shouldBe false | ||
someEncrypted.isEmpty() shouldBe false | ||
} | ||
} | ||
}) |