Skip to content

Commit fe7f76e

Browse files
committed
Update tests.
1 parent 5738f92 commit fe7f76e

File tree

5 files changed

+10
-14
lines changed

5 files changed

+10
-14
lines changed

src/Authentication/Authentication.Core/Microsoft.Graph.Authentication.Core.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@
44
<TargetFrameworks>netstandard2.0;net6.0;net472</TargetFrameworks>
55
<RootNamespace>Microsoft.Graph.PowerShell.Authentication.Core</RootNamespace>
66
<VersionPrefix>2.0.0</VersionPrefix>
7-
<VersionSuffix>rc3</VersionSuffix>
7+
<VersionSuffix>rc4</VersionSuffix>
88
</PropertyGroup>
99
<PropertyGroup>
1010
<EnableNETAnalyzers>true</EnableNETAnalyzers>
1111
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
1212
</PropertyGroup>
1313
<ItemGroup>
14-
<PackageReference Include="Azure.Identity" Version="1.8.2" />
14+
<PackageReference Include="Azure.Identity" Version="1.9.0" />
1515
<PackageReference Include="Microsoft.Graph.Core" Version="3.0.7" />
1616
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
1717
</ItemGroup>

src/Authentication/Authentication.Core/TokenCache/InMemoryTokenCacheOptions.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,7 @@ protected override async Task<TokenCacheData> RefreshCacheAsync(TokenCacheRefres
2525
_sessionLock.EnterReadLock();
2626
try
2727
{
28-
return await Task.Run(() =>
29-
{
30-
return new TokenCacheData(TokenCache);
31-
}, cancellationToken);
28+
return await Task.FromResult(new TokenCacheData(TokenCache)).ConfigureAwait(false);
3229
}
3330
finally
3431
{

src/Authentication/Authentication.Test/Handlers/HttpVersionHandlerTests.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
using Microsoft.Graph.PowerShell.Authentication.Handlers;
22
using System;
3-
using System.Collections.Generic;
4-
using System.Linq;
53
using System.Net.Http;
6-
using System.Text;
74
using System.Threading;
85
using System.Threading.Tasks;
96
using Xunit;
@@ -37,7 +34,9 @@ public async Task ShouldSetHttpMessageVersionTo2()
3734
// Assert
3835
Assert.NotNull(sentRequest);
3936
Assert.Equal(requestUrl, sentRequest.RequestUri);
37+
# if NET6_0_OR_GREATER
4038
Assert.Equal(sentRequest.Version, new Version(2, 0));
39+
# endif
4140
}
4241

4342
public void Dispose()

src/Authentication/Authentication.Test/Helpers/AuthenticationHelpersTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public async Task ShouldUseDelegateAuthProviderWhenUserAccessTokenIsProvidedAsyn
4141
};
4242

4343
AzureIdentityAccessTokenProvider authProvider = await AuthenticationHelpers.GetAuthenticationProviderAsync(userProvidedAuthContext);
44-
HttpRequestMessage requestMessage = new HttpRequestMessage();
44+
HttpRequestMessage requestMessage = new HttpRequestMessage(HttpMethod.Get, "https://graph.microsoft.com/v1.0/me");
4545

4646
// Act
4747
var accessToken = await authProvider.GetAuthorizationTokenAsync(requestMessage.RequestUri);

src/Authentication/Authentication.Test/Microsoft.Graph.Authentication.Test.csproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@
66
</PropertyGroup>
77

88
<ItemGroup>
9-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.1.0" />
9+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.6.2" />
1010
<!-- As described in this post https://devblogs.microsoft.com/powershell/depending-on-the-right-powershell-nuget-package-in-your-net-project, reference the SDK for dotnetcore-->
1111
<PackageReference Include="Microsoft.PowerShell.SDK" Version="7.2.2" PrivateAssets="all" Condition="'$(TargetFramework)' == 'net6.0'" />
12-
<PackageReference Include="xunit" Version="2.4.1" />
13-
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3">
12+
<PackageReference Include="xunit" Version="2.4.2" />
13+
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
1414
<PrivateAssets>all</PrivateAssets>
1515
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
1616
</PackageReference>
17-
<PackageReference Include="coverlet.collector" Version="3.1.2">
17+
<PackageReference Include="coverlet.collector" Version="6.0.0">
1818
<PrivateAssets>all</PrivateAssets>
1919
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
2020
</PackageReference>

0 commit comments

Comments
 (0)