Skip to content

Commit

Permalink
SNOW-723810: Add coverage for RestRequest
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-ext-simba-lf committed Oct 6, 2023
1 parent ad92e98 commit 3de0c09
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Snowflake.Data.Tests/UnitTests/SFOktaTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,14 @@ public void TestWrongPostbackUrl()
[Test]
public void TestLoginRequestToString()
{
// Arrange
string expectedOktaAccount = "mockOktaAccount";
string expectedOktaUser = "mockOktaUser";
string expectedOktaUrl = "mockOktaUrl";

LoginRequestClientEnv loginRequestClientEnv = new LoginRequestClientEnv();

// Act
LoginRequest loginRequest = new LoginRequest()
{
data = new LoginRequestData()
Expand All @@ -90,6 +93,7 @@ public void TestLoginRequestToString()
}
};

// Assert
Assert.AreEqual($"LoginRequest {{data: LoginRequestData {{ClientAppVersion: {SFEnvironment.DriverVersion},\n " +
$"AccountName: {expectedOktaAccount},\n " +
$"loginName: {expectedOktaUser},\n " +
Expand All @@ -106,7 +110,10 @@ public void TestLoginRequestToString()
[Test]
public void TestAuthenticatorRequestToString()
{
// Arrange
string expectedOktaAccount = "mockOktaAccount";

// Act
AuthenticatorRequest authenticatorRequest = new AuthenticatorRequest()
{
Data = new AuthenticatorRequestData()
Expand All @@ -115,6 +122,7 @@ public void TestAuthenticatorRequestToString()
}
};

// Assert
Assert.AreEqual($"AuthenticatorRequest {{data: AuthenticatorRequestData {{ACCOUNT_NAME: {expectedOktaAccount} }} }}",
authenticatorRequest.ToString());
}
Expand Down

0 comments on commit 3de0c09

Please sign in to comment.