From fad80fbd69174dc11189155b176612f62da24028 Mon Sep 17 00:00:00 2001 From: David Perez Date: Tue, 5 Dec 2023 10:46:15 -0600 Subject: [PATCH] Format GeneratorSdkSourceTest (#324) --- .../datasource/sdk/GeneratorSdkSourceTest.kt | 80 +++++++++---------- 1 file changed, 40 insertions(+), 40 deletions(-) diff --git a/app/src/test/java/com/x8bit/bitwarden/data/tools/generator/datasource/sdk/GeneratorSdkSourceTest.kt b/app/src/test/java/com/x8bit/bitwarden/data/tools/generator/datasource/sdk/GeneratorSdkSourceTest.kt index a89e61dae..e33e2198b 100644 --- a/app/src/test/java/com/x8bit/bitwarden/data/tools/generator/datasource/sdk/GeneratorSdkSourceTest.kt +++ b/app/src/test/java/com/x8bit/bitwarden/data/tools/generator/datasource/sdk/GeneratorSdkSourceTest.kt @@ -14,57 +14,57 @@ class GeneratorSdkSourceTest { private val clientGenerators = mockk() private val generatorSdkSource: GeneratorSdkSource = GeneratorSdkSourceImpl(clientGenerators) - @Suppress("MaxLineLength") @Test - fun `generatePassword should call SDK and return a Result with the generated password`() = runBlocking { - val request = PasswordGeneratorRequest( - lowercase = true, - uppercase = true, - numbers = true, - special = true, - length = 12.toUByte(), - avoidAmbiguous = false, - minLowercase = 1U, - minUppercase = 1U, - minNumber = 1U, - minSpecial = 1U, - ) - val expectedResult = "GeneratedPassword123!" + fun `generatePassword should call SDK and return a Result with the generated password`() = + runBlocking { + val request = PasswordGeneratorRequest( + lowercase = true, + uppercase = true, + numbers = true, + special = true, + length = 12U, + avoidAmbiguous = false, + minLowercase = 1U, + minUppercase = 1U, + minNumber = 1U, + minSpecial = 1U, + ) + val expectedResult = "GeneratedPassword123!" - coEvery { - clientGenerators.password(request) - } returns expectedResult + coEvery { + clientGenerators.password(request) + } returns expectedResult - val result = generatorSdkSource.generatePassword(request) + val result = generatorSdkSource.generatePassword(request) - assertEquals(Result.success(expectedResult), result) + assertEquals(Result.success(expectedResult), result) - coVerify { - clientGenerators.password(request) + coVerify { + clientGenerators.password(request) + } } - } - @Suppress("MaxLineLength") @Test - fun `generatePassphrase should call SDK and return a Result with the generated passphrase`() = runBlocking { - val request = PassphraseGeneratorRequest( - numWords = 4.toUByte(), - wordSeparator = "-", - capitalize = true, - includeNumber = true, - ) - val expectedResult = "Generated-Passphrase123" + fun `generatePassphrase should call SDK and return a Result with the generated passphrase`() = + runBlocking { + val request = PassphraseGeneratorRequest( + numWords = 4U, + wordSeparator = "-", + capitalize = true, + includeNumber = true, + ) + val expectedResult = "Generated-Passphrase123" - coEvery { - clientGenerators.passphrase(request) - } returns expectedResult + coEvery { + clientGenerators.passphrase(request) + } returns expectedResult - val result = generatorSdkSource.generatePassphrase(request) + val result = generatorSdkSource.generatePassphrase(request) - assertEquals(Result.success(expectedResult), result) + assertEquals(Result.success(expectedResult), result) - coVerify { - clientGenerators.passphrase(request) + coVerify { + clientGenerators.passphrase(request) + } } - } }