From faedc8dc351f342890e9bacfd77534bb39a7910c Mon Sep 17 00:00:00 2001 From: Gudge Date: Mon, 2 Mar 2020 15:05:47 -0800 Subject: [PATCH] Minor improvements to authorization tests (#2118) 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. --- Octokit.Tests/Clients/AuthorizationsClientTests.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Octokit.Tests/Clients/AuthorizationsClientTests.cs b/Octokit.Tests/Clients/AuthorizationsClientTests.cs index 1f0f13d5a9..392ec0a42c 100644 --- a/Octokit.Tests/Clients/AuthorizationsClientTests.cs +++ b/Octokit.Tests/Clients/AuthorizationsClientTests.cs @@ -126,8 +126,9 @@ public void GetsOrCreatesAuthenticationAtCorrectUrl() authEndpoint.GetOrCreateApplicationAuthentication("clientId", "secret", data); - client.Received().Put(Arg.Is(u => u.ToString() == "authorizations/clients/clientId"), - Args.Object); + client.Received().Put( + Arg.Is(u => u.ToString() == "authorizations/clients/clientId"), + Arg.Is(o => o.GetType().GetProperty("client_secret").GetValue(o).ToString() == "secret")); } [Fact] @@ -141,7 +142,7 @@ public void GetsOrCreatesAuthenticationAtCorrectUrlUsingTwoFactor() client.Received().Put( Arg.Is(u => u.ToString() == "authorizations/clients/clientId"), - Args.Object, + Arg.Is(o => o.GetType().GetProperty("client_secret").GetValue(o).ToString() == "secret"), "two-factor"); }