From c555609f164eb5245eb1cceb3fe22ec1d258ec5d Mon Sep 17 00:00:00 2001 From: Harsh Shandilya Date: Tue, 3 May 2022 01:48:16 +0530 Subject: Misc cleanups (#1891) --- .../dev/msfjarvis/aps/data/passfile/PasswordEntryTest.kt | 16 ++++++++-------- .../test/kotlin/dev/msfjarvis/aps/util/totp/OtpTest.kt | 10 +++++----- 2 files changed, 13 insertions(+), 13 deletions(-) (limited to 'format-common/src') diff --git a/format-common/src/test/kotlin/dev/msfjarvis/aps/data/passfile/PasswordEntryTest.kt b/format-common/src/test/kotlin/dev/msfjarvis/aps/data/passfile/PasswordEntryTest.kt index 201eb611..27fbe0e2 100644 --- a/format-common/src/test/kotlin/dev/msfjarvis/aps/data/passfile/PasswordEntryTest.kt +++ b/format-common/src/test/kotlin/dev/msfjarvis/aps/data/passfile/PasswordEntryTest.kt @@ -34,7 +34,7 @@ class PasswordEntryTest { ) @Test - fun testGetPassword() { + fun getPassword() { assertEquals("fooooo", makeEntry("fooooo\nbla\n").password) assertEquals("fooooo", makeEntry("fooooo\nbla").password) assertEquals("fooooo", makeEntry("fooooo\n").password) @@ -52,7 +52,7 @@ class PasswordEntryTest { } @Test - fun testGetExtraContent() { + fun getExtraContent() { assertEquals("bla\n", makeEntry("fooooo\nbla\n").extraContentString) assertEquals("bla", makeEntry("fooooo\nbla").extraContentString) assertEquals("", makeEntry("fooooo\n").extraContentString) @@ -103,7 +103,7 @@ class PasswordEntryTest { } @Test - fun testGetUsername() { + fun getUsername() { for (field in PasswordEntry.USERNAME_FIELDS) { assertEquals("username", makeEntry("\n$field username").username) assertEquals( @@ -123,7 +123,7 @@ class PasswordEntryTest { } @Test - fun testHasUsername() { + fun hasUsername() { assertNotNull(makeEntry("secret\nextra\nlogin: username\ncontent\n").username) assertNull(makeEntry("secret\nextra\ncontent\n").username) assertNull(makeEntry("secret\nlogin failed\n").username) @@ -132,7 +132,7 @@ class PasswordEntryTest { } @Test - fun testGeneratesOtpFromTotpUri() = runTest { + fun generatesOtpFromTotpUri() = runTest { val entry = makeEntry("secret\nextra\n$TOTP_URI") assertTrue(entry.hasTotp()) entry.totp.test { @@ -149,7 +149,7 @@ class PasswordEntryTest { * blocked https://msfjarvis.dev/aps/issue/1550. */ @Test - fun testGeneratedOtpHasCorrectRemainingTime() = runTest { + fun generatedOtpHasCorrectRemainingTime() = runTest { val entry = makeEntry("secret\nextra\n$TOTP_URI", TestUserClock.withAddedSeconds(5)) assertTrue(entry.hasTotp()) entry.totp.test { @@ -161,7 +161,7 @@ class PasswordEntryTest { } @Test - fun testGeneratesOtpWithOnlyUriInFile() = runTest { + fun generatesOtpWithOnlyUriInFile() = runTest { val entry = makeEntry(TOTP_URI) assertNull(entry.password) entry.totp.test { @@ -173,7 +173,7 @@ class PasswordEntryTest { } @Test - fun testOnlyLooksForUriInFirstLine() { + fun onlyLooksForUriInFirstLine() { val entry = makeEntry("id:\n$TOTP_URI") assertNotNull(entry.password) assertTrue(entry.hasTotp()) diff --git a/format-common/src/test/kotlin/dev/msfjarvis/aps/util/totp/OtpTest.kt b/format-common/src/test/kotlin/dev/msfjarvis/aps/util/totp/OtpTest.kt index 67195361..db74de3e 100644 --- a/format-common/src/test/kotlin/dev/msfjarvis/aps/util/totp/OtpTest.kt +++ b/format-common/src/test/kotlin/dev/msfjarvis/aps/util/totp/OtpTest.kt @@ -24,7 +24,7 @@ class OtpTest { } @Test - fun testOtpGeneration6Digits() { + fun otpGeneration6Digits() { assertEquals( "953550", generateOtp( @@ -46,7 +46,7 @@ class OtpTest { } @Test - fun testOtpGeneration10Digits() { + fun otpGeneration10Digits() { assertEquals( "0740900914", generateOtp( @@ -71,7 +71,7 @@ class OtpTest { } @Test - fun testOtpGenerationIllegalInput() { + fun otpGenerationIllegalInput() { assertNull( generateOtp( counter = 10000, @@ -108,7 +108,7 @@ class OtpTest { } @Test - fun testOtpGenerationUnusualSecrets() { + fun otpGenerationUnusualSecrets() { assertEquals( "127764", generateOtp( @@ -126,7 +126,7 @@ class OtpTest { } @Test - fun testOtpGenerationUnpaddedSecrets() { + fun otpGenerationUnpaddedSecrets() { // Secret was generated with `echo 'string with some padding needed' | base32` // We don't care for the resultant OTP's actual value, we just want both the padded and // unpadded variant to generate the same one. -- cgit v1.2.3