Skip to content

Commit

Permalink
Minor improvements to authorization tests (#2118)
Browse files Browse the repository at this point in the history
Minor improvements to a couple of tests in
TheGetOrCreateApplicationAuthenticationMethod to verify the interesting
piece of the request object. This brings these tests into line with
recent changes to tests in TheCheckApplicationAuthenticationMethod
et.al.
  • Loading branch information
MGudgin authored Mar 2, 2020
1 parent c1c6366 commit faedc8d
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Octokit.Tests/Clients/AuthorizationsClientTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,9 @@ public void GetsOrCreatesAuthenticationAtCorrectUrl()

authEndpoint.GetOrCreateApplicationAuthentication("clientId", "secret", data);

client.Received().Put<ApplicationAuthorization>(Arg.Is<Uri>(u => u.ToString() == "authorizations/clients/clientId"),
Args.Object);
client.Received().Put<ApplicationAuthorization>(
Arg.Is<Uri>(u => u.ToString() == "authorizations/clients/clientId"),
Arg.Is<Object>(o => o.GetType().GetProperty("client_secret").GetValue(o).ToString() == "secret"));
}

[Fact]
Expand All @@ -141,7 +142,7 @@ public void GetsOrCreatesAuthenticationAtCorrectUrlUsingTwoFactor()

client.Received().Put<ApplicationAuthorization>(
Arg.Is<Uri>(u => u.ToString() == "authorizations/clients/clientId"),
Args.Object,
Arg.Is<Object>(o => o.GetType().GetProperty("client_secret").GetValue(o).ToString() == "secret"),
"two-factor");
}

Expand Down

0 comments on commit faedc8d

Please sign in to comment.