forked from awsdocs/aws-doc-sdk-examples
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8f7c0e7
commit 6e3eea9
Showing
2 changed files
with
40 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,11 +5,15 @@ namespace Cognito_MVP.Tests | |
{ | ||
public class CognitoMethodsTests | ||
{ | ||
private static AmazonCognitoIdentityProviderClient _Client = new AmazonCognitoIdentityProviderClient(); | ||
private static readonly AmazonCognitoIdentityProviderClient _Client = new AmazonCognitoIdentityProviderClient(); | ||
private static readonly string _UserName = "test-user"; | ||
private static readonly string _Password = "really-bad-password"; | ||
private static readonly string _UserEmail = "[email protected]"; | ||
private static readonly string _ClientId = "some-client-id"; | ||
private static string _Session = ""; | ||
private static string _MfaCode = ""; | ||
|
||
private static readonly string _PoolId = ""; | ||
private static string _Session = string.Empty; | ||
private static string _MfaCode = string.Empty; | ||
|
||
[Fact] | ||
[Order(1)] | ||
|
@@ -44,42 +48,46 @@ public static async Task VerifyTOTPTest() | |
[Order(6)] | ||
public static async Task GetSecretForAppMFATest() | ||
{ | ||
|
||
var session = await CognitoMethods.GetSecretForAppMFA(_Client, _Session); | ||
Assert.Equal(_Session, session, true); | ||
} | ||
|
||
[Fact] | ||
[Order(5)] | ||
public void InitiateAuthTest() | ||
public static async Task InitiateAuthTest() | ||
{ | ||
Assert.True(false, "This test needs an implementation"); | ||
var response = await CognitoMethods.InitiateAuth(_Client, _ClientId, _UserName, _Password); | ||
Assert.NotNull(response.Session); | ||
} | ||
|
||
[Fact] | ||
[Order(4)] | ||
public void ConfirmSignUpTest() | ||
public static async Task ConfirmSignUpTest() | ||
{ | ||
Assert.True(false, "This test needs an implementation"); | ||
var success = await CognitoMethods.ConfirmSignUp(_Client, _ClientId, _UserName, _Password); | ||
Assert.True(success, "Couldn't confirm the user's signup status."); | ||
} | ||
|
||
[Fact] | ||
[Order(3)] | ||
public void ResendConfirmationCodeTest() | ||
public static async Task ResendConfirmationCodeTest() | ||
{ | ||
Assert.True(false, "This test needs an implementation"); | ||
await CognitoMethods.ResendConfirmationCode(_Client, _ClientId, _UserName); | ||
// What do I test here? | ||
} | ||
|
||
[Fact] | ||
[Order(2)] | ||
public void GetAdminUserTest() | ||
public static async Task GetAdminUserTest() | ||
{ | ||
Assert.True(false, "This test needs an implementation"); | ||
await CognitoMethods.GetAdminUser(_Client, _UserName, _PoolId); | ||
} | ||
|
||
[Fact] | ||
[Order(1)] | ||
public void SignUpTest() | ||
public static async Task SignUpTest() | ||
{ | ||
Assert.True(false, "This test needs an implementation"); | ||
await CognitoMethods.SignUp(_Client, _ClientId, _UserName, _Password, _UserEmail); | ||
} | ||
} | ||
} |