aboutsummaryrefslogtreecommitdiffstats
path: root/app/src/androidTest/java/com/zeapo/pwdstore/utils
diff options
context:
space:
mode:
authorHarsh Shandilya <msfjarvis@gmail.com>2020-07-24 14:33:55 +0530
committerGitHub <noreply@github.com>2020-07-24 14:33:55 +0530
commite3cf73885c112bc553d6a0cc01d594a87728f448 (patch)
tree724a3023a7e76d13065dd2ad900d4a24454b409e /app/src/androidTest/java/com/zeapo/pwdstore/utils
parentf256d5f2447a62af0e881eed56749cd0db610c8c (diff)
downloadHardenedPass-e3cf73885c112bc553d6a0cc01d594a87728f448.tar.gz
HardenedPass-e3cf73885c112bc553d6a0cc01d594a87728f448.zip
Expand OTP and PasswordEntry tests (#968)
Diffstat (limited to 'app/src/androidTest/java/com/zeapo/pwdstore/utils')
-rw-r--r--app/src/androidTest/java/com/zeapo/pwdstore/utils/UriTotpFinderTest.kt5
1 files changed, 5 insertions, 0 deletions
diff --git a/app/src/androidTest/java/com/zeapo/pwdstore/utils/UriTotpFinderTest.kt b/app/src/androidTest/java/com/zeapo/pwdstore/utils/UriTotpFinderTest.kt
index 8a836f89..0e4ac51c 100644
--- a/app/src/androidTest/java/com/zeapo/pwdstore/utils/UriTotpFinderTest.kt
+++ b/app/src/androidTest/java/com/zeapo/pwdstore/utils/UriTotpFinderTest.kt
@@ -16,25 +16,30 @@ class UriTotpFinderTest {
fun findSecret() {
assertEquals("HXDMVJECJJWSRB3HWIZR4IFUGFTMXBOZ", totpFinder.findSecret(TOTP_URI))
assertEquals("HXDMVJECJJWSRB3HWIZR4IFUGFTMXBOZ", totpFinder.findSecret("name\npassword\ntotp: HXDMVJECJJWSRB3HWIZR4IFUGFTMXBOZ"))
+ assertEquals("HXDMVJECJJWSRB3HWIZR4IFUGFTMXBOZ", totpFinder.findSecret(PASS_FILE_CONTENT))
}
@Test
fun findDigits() {
assertEquals("12", totpFinder.findDigits(TOTP_URI))
+ assertEquals("12", totpFinder.findDigits(PASS_FILE_CONTENT))
}
@Test
fun findPeriod() {
assertEquals(25, totpFinder.findPeriod(TOTP_URI))
+ assertEquals(25, totpFinder.findPeriod(PASS_FILE_CONTENT))
}
@Test
fun findAlgorithm() {
assertEquals("SHA256", totpFinder.findAlgorithm(TOTP_URI))
+ assertEquals("SHA256", totpFinder.findAlgorithm(PASS_FILE_CONTENT))
}
companion object {
const val TOTP_URI = "otpauth://totp/ACME%20Co:john@example.com?secret=HXDMVJECJJWSRB3HWIZR4IFUGFTMXBOZ&issuer=ACME%20Co&algorithm=SHA256&digits=12&period=25"
+ const val PASS_FILE_CONTENT = "password\n$TOTP_URI"
}
}