Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@
B4F3EA4F243A782700F23296 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = B4F3EA4C243A782700F23296 /* ViewController.swift */; };
B4F3EA50243A782700F23296 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = B4F3EA4D243A782700F23296 /* AppDelegate.swift */; };
B4F3EA51243A782700F23296 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = B4F3EA4E243A782700F23296 /* SceneDelegate.swift */; };
D828362C2590527F0016173F /* BaseUserBehaviorTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = D828362B2590527F0016173F /* BaseUserBehaviorTest.swift */; };
D87D5864257EF27E004617B3 /* BaseAuthDeviceTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = D87D5863257EF27E004617B3 /* BaseAuthDeviceTest.swift */; };
FA1C817D25868C46006160E9 /* AWSCognitoAuthPluginAmplifyVersionableTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = FA1C817C25868C46006160E9 /* AWSCognitoAuthPluginAmplifyVersionableTests.swift */; };
FA6B0EA8249443C90062AA59 /* AWSCognitoAuthPluginConfigTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = FA6B0EA7249443C90062AA59 /* AWSCognitoAuthPluginConfigTests.swift */; };
Expand Down Expand Up @@ -350,6 +351,7 @@
B4F3EA4E243A782700F23296 /* SceneDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = "<group>"; };
C49A4C812B0F973F5536DCC8 /* Pods-AWSAuthPlugin.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-AWSAuthPlugin.release.xcconfig"; path = "Target Support Files/Pods-AWSAuthPlugin/Pods-AWSAuthPlugin.release.xcconfig"; sourceTree = "<group>"; };
C5E50D8021B9740CB511898D /* Pods-AWSAuthPlugin.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-AWSAuthPlugin.debug.xcconfig"; path = "Target Support Files/Pods-AWSAuthPlugin/Pods-AWSAuthPlugin.debug.xcconfig"; sourceTree = "<group>"; };
D828362B2590527F0016173F /* BaseUserBehaviorTest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BaseUserBehaviorTest.swift; sourceTree = "<group>"; };
D87D5863257EF27E004617B3 /* BaseAuthDeviceTest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BaseAuthDeviceTest.swift; sourceTree = "<group>"; };
E9289652B314AA0AA1F31BC8 /* Pods-HostApp.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-HostApp.release.xcconfig"; path = "Target Support Files/Pods-HostApp/Pods-HostApp.release.xcconfig"; sourceTree = "<group>"; };
FA1C817C25868C46006160E9 /* AWSCognitoAuthPluginAmplifyVersionableTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AWSCognitoAuthPluginAmplifyVersionableTests.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -537,6 +539,7 @@
B4136E6B256D7AF30011210B /* UserBehaviorFetchAttributeTests.swift */,
B4136E7B256D7B240011210B /* UserBehaviorResendCodeTests.swift */,
B4136E75256D7B090011210B /* UserBehaviorUpdateAttributeTests.swift */,
D828362B2590527F0016173F /* BaseUserBehaviorTest.swift */,
);
path = AuthUserBehaviorTests;
sourceTree = "<group>";
Expand Down Expand Up @@ -1529,6 +1532,7 @@
B4136E20256D757C0011210B /* AuthenticationProviderConfirmSignupTests.swift in Sources */,
B4136E3E256D76960011210B /* AuthenticationProviderSignoutTests.swift in Sources */,
B4136E5E256D7A690011210B /* AuthorizationProviderSessionSignInTests.swift in Sources */,
D828362C2590527F0016173F /* BaseUserBehaviorTest.swift in Sources */,
B43B4E242565FEC3008F345D /* AWSCognitoAuthUserBehaviorTests.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
//
// Copyright 2018-2020 Amazon.com,
// Inc. or its affiliates. All Rights Reserved.
//
// SPDX-License-Identifier: Apache-2.0
//

import XCTest
@testable import Amplify
@testable import AWSCognitoAuthPlugin
@testable import AWSMobileClient

class BaseUserBehaviorTest: XCTestCase {

let apiTimeout = 2.0
var authUserService: AuthUserServiceAdapter!
var mockAWSMobileClient: MockAWSMobileClient!
var plugin: AWSCognitoAuthPlugin!

override func setUp() {
mockAWSMobileClient = MockAWSMobileClient()
authUserService = AuthUserServiceAdapter(awsMobileClient: mockAWSMobileClient!)
plugin = AWSCognitoAuthPlugin()
plugin?.configure(authenticationProvider: MockAuthenticationProviderBehavior(),
authorizationProvider: MockAuthorizationProviderBehavior(),
userService: authUserService,
deviceService: MockAuthDeviceServiceBehavior(),
hubEventHandler: MockAuthHubEventBehavior())
}

override func tearDown() {
plugin = nil
mockAWSMobileClient = nil
authUserService = nil
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,6 @@ import XCTest
@testable import AWSCognitoAuthPlugin
@testable import AWSMobileClient

class UserBehaviorChangePasswordTests: XCTestCase {
class UserBehaviorChangePasswordTests: BaseUserBehaviorTest {

var authenticationProvider: AuthenticationProviderAdapter!
var mockAWSMobileClient: MockAWSMobileClient!
var plugin: AWSCognitoAuthPlugin!

override func setUp() {
mockAWSMobileClient = MockAWSMobileClient()
authenticationProvider = AuthenticationProviderAdapter(awsMobileClient: mockAWSMobileClient!)
plugin = AWSCognitoAuthPlugin()
plugin?.configure(authenticationProvider: authenticationProvider,
authorizationProvider: MockAuthorizationProviderBehavior(),
userService: MockAuthUserServiceBehavior(),
deviceService: MockAuthDeviceServiceBehavior(),
hubEventHandler: MockAuthHubEventBehavior())
}
}
Loading