Skip to content

Commit

Permalink
chore: Adressing PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
sebaland committed Oct 20, 2023
1 parent 681b503 commit bcec936
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,21 @@
import XCTest

class CognitoUserPoolASFTests: XCTestCase {
private var pool: CognitoUserPoolASF!
private var userPool: CognitoUserPoolASF!

override func setUp() {
pool = CognitoUserPoolASF()
userPool = CognitoUserPoolASF()
}

override func tearDown() {
pool = nil
userPool = nil
}

/// Given: A CognitoUserPoolASF
/// When: userContextData is invoked
/// Then: A non-empty string is returned
func testUserContextData_shouldReturnData() throws {
let result = try pool.userContextData(
let result = try userPool.userContextData(
for: "TestUser",
deviceInfo: ASFDeviceInfo(id: "mockedDevice"),
appInfo: ASFAppInfo(),
Expand All @@ -36,18 +36,19 @@ class CognitoUserPoolASFTests: XCTestCase {
/// When: calculateSecretHash is invoked
/// Then: A non-empty string is returned
func testCalculateSecretHash_shouldReturnHash() throws {
let result = try pool.calculateSecretHash(
let result = try userPool.calculateSecretHash(
contextJson: "contextJson",
clientId: "clientId"
)
XCTAssertFalse(result.isEmpty)
}

/// Given: A CognitoUserPoolASF
/// When: calculateSecretHash is invoked with a clientId that cannot be parsed
/// Then: A ASFError.hashKey is thrown
func testCalculateSecretHash_withInvalidClientId_shouldThrowHashKeyError() {
do {
let result = try pool.calculateSecretHash(
let result = try userPool.calculateSecretHash(
contextJson: "contextJson",
clientId: "🕺🏼" // This string cannot be represented using .ascii, so it will throw an error
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
//

@testable import Amplify
//@testable import func AmplifyTestCommon.XCTAssertThrowFatalError
@testable import AWSS3StoragePlugin
import AWSS3
import XCTest
Expand Down

0 comments on commit bcec936

Please sign in to comment.