Skip to content

Commit 273ce36

Browse files
authored
change: Update project target frameworks and dependencies (#251)
* Upgrade project target frameworks and dependencies * Fix tests and snippets * Remove redundant usings * Update README.md * Change target framework of tests and snippets to .NET Core 2.1 * Remove unnecessary preprocessor directives * Update Google.Api.Gax.Rest to 3.2.0. Remove explicit Google.Api.Gax reference
1 parent 1ed0335 commit 273ce36

29 files changed

+68
-115
lines changed

FirebaseAdmin/FirebaseAdmin.IntegrationTests/Auth/AbstractFirebaseAuthTest.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -481,10 +481,10 @@ public async Task ListUsers()
481481
}
482482

483483
var pagedEnumerable = this.Auth.ListUsersAsync(null);
484-
var enumerator = pagedEnumerable.GetEnumerator();
484+
var enumerator = pagedEnumerable.GetAsyncEnumerator();
485485

486486
var listedUsers = new List<string>();
487-
while (await enumerator.MoveNext())
487+
while (await enumerator.MoveNextAsync())
488488
{
489489
var uid = enumerator.Current.Uid;
490490
if (users.Contains(uid) && !listedUsers.Contains(uid))

FirebaseAdmin/FirebaseAdmin.IntegrationTests/Auth/AbstractOidcProviderConfigTest.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
using System.Collections.Generic;
1615
using System.Threading.Tasks;
1716
using FirebaseAdmin.Auth;
1817
using FirebaseAdmin.Auth.Providers;
@@ -69,8 +68,8 @@ public async Task ListProviderConfig()
6968
OidcProviderConfig config = null;
7069

7170
var pagedEnumerable = this.auth.ListOidcProviderConfigsAsync(null);
72-
var enumerator = pagedEnumerable.GetEnumerator();
73-
while (await enumerator.MoveNext())
71+
var enumerator = pagedEnumerable.GetAsyncEnumerator();
72+
while (await enumerator.MoveNextAsync())
7473
{
7574
if (enumerator.Current.ProviderId == this.providerId)
7675
{

FirebaseAdmin/FirebaseAdmin.IntegrationTests/Auth/AbstractSamlProviderConfigTest.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@ public async Task ListProviderConfig()
7575
SamlProviderConfig config = null;
7676

7777
var pagedEnumerable = this.auth.ListSamlProviderConfigsAsync(null);
78-
var enumerator = pagedEnumerable.GetEnumerator();
79-
while (await enumerator.MoveNext())
78+
var enumerator = pagedEnumerable.GetAsyncEnumerator();
79+
while (await enumerator.MoveNextAsync())
8080
{
8181
if (enumerator.Current.ProviderId == this.providerId)
8282
{

FirebaseAdmin/FirebaseAdmin.IntegrationTests/Auth/TenantManagerTest.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
using System.Collections.Generic;
1615
using System.Threading.Tasks;
1716
using FirebaseAdmin.Auth;
1817
using FirebaseAdmin.Auth.Multitenancy;
@@ -63,8 +62,8 @@ public async Task ListTenants()
6362

6463
var pagedEnumerable = FirebaseAuth.DefaultInstance.TenantManager
6564
.ListTenantsAsync(null);
66-
var enumerator = pagedEnumerable.GetEnumerator();
67-
while (await enumerator.MoveNext())
65+
var enumerator = pagedEnumerable.GetAsyncEnumerator();
66+
while (await enumerator.MoveNextAsync())
6867
{
6968
if (enumerator.Current.TenantId == this.fixture.TenantId)
7069
{

FirebaseAdmin/FirebaseAdmin.IntegrationTests/FirebaseAdmin.IntegrationTests.csproj

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>netcoreapp2.0</TargetFramework>
4+
<TargetFramework>netcoreapp2.1</TargetFramework>
55
<LangVersion>latest</LangVersion>
66
<IsPackable>false</IsPackable>
77
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
88
<CodeAnalysisRuleSet>../../stylecop_test.ruleset</CodeAnalysisRuleSet>
99
</PropertyGroup>
1010

1111
<ItemGroup>
12-
<PackageReference Include="Google.Apis.Auth" Version="1.40.0" />
13-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.7.0" />
14-
<PackageReference Include="xunit" Version="2.3.1" />
15-
<PackageReference Include="xunit.runner.visualstudio" Version="2.3.1" />
12+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.7.1" />
13+
<PackageReference Include="xunit" Version="2.4.1" />
14+
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3">
15+
<PrivateAssets>all</PrivateAssets>
16+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
17+
</PackageReference>
1618
<DotNetCliToolReference Include="dotnet-xunit" Version="2.3.1" />
1719
<PackageReference Include="StyleCop.Analyzers" Version="1.1.1-beta.61">
1820
<PrivateAssets>all</PrivateAssets>

FirebaseAdmin/FirebaseAdmin.IntegrationTests/IntegrationTestUtils.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,7 @@
1313
// limitations under the License.
1414

1515
using System;
16-
using System.Collections.Generic;
17-
using System.IO;
18-
using FirebaseAdmin;
1916
using Google.Apis.Auth.OAuth2;
20-
using Google.Apis.Json;
2117

2218
namespace FirebaseAdmin.IntegrationTests
2319
{

FirebaseAdmin/FirebaseAdmin.Snippets/FirebaseAdmin.Snippets.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>netcoreapp2.0</TargetFramework>
4+
<TargetFramework>netcoreapp2.1</TargetFramework>
55
<IsPackable>false</IsPackable>
66
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
77
<CodeAnalysisRuleSet>../../stylecop_test.ruleset</CodeAnalysisRuleSet>
88
</PropertyGroup>
99

1010
<ItemGroup>
11-
<PackageReference Include="Google.Apis.Auth" Version="1.40.0" />
12-
<PackageReference Include="Microsoft.AspNetCore.Http" Version="2.2.0" />
11+
<PackageReference Include="Google.Apis.Auth" Version="1.49.0" />
12+
<PackageReference Include="Microsoft.AspNetCore.Http" Version="2.2.2" />
1313
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="2.2.0" />
1414
</ItemGroup>
1515

FirebaseAdmin/FirebaseAdmin.Snippets/FirebaseAppSnippets.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414

1515
using System;
1616
// [START using_namespace_decl]
17-
using FirebaseAdmin;
1817
using FirebaseAdmin.Auth;
1918
using Google.Apis.Auth.OAuth2;
2019
// [END using_namespace_decl]

FirebaseAdmin/FirebaseAdmin.Snippets/FirebaseAuthSnippets.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -498,8 +498,8 @@ internal static async Task ListAllUsersAsync()
498498
// [START list_all_users]
499499
// Start listing users from the beginning, 1000 at a time.
500500
var pagedEnumerable = FirebaseAuth.DefaultInstance.ListUsersAsync(null);
501-
var responses = pagedEnumerable.AsRawResponses().GetEnumerator();
502-
while (await responses.MoveNext())
501+
var responses = pagedEnumerable.AsRawResponses().GetAsyncEnumerator();
502+
while (await responses.MoveNextAsync())
503503
{
504504
ExportedUserRecords response = responses.Current;
505505
foreach (ExportedUserRecord user in response.Users)
@@ -510,8 +510,8 @@ internal static async Task ListAllUsersAsync()
510510

511511
// Iterate through all users. This will still retrieve users in batches,
512512
// buffering no more than 1000 users in memory at a time.
513-
var enumerator = FirebaseAuth.DefaultInstance.ListUsersAsync(null).GetEnumerator();
514-
while (await enumerator.MoveNext())
513+
var enumerator = FirebaseAuth.DefaultInstance.ListUsersAsync(null).GetAsyncEnumerator();
514+
while (await enumerator.MoveNextAsync())
515515
{
516516
ExportedUserRecord user = enumerator.Current;
517517
Console.WriteLine($"User: {user.Uid}");
@@ -756,9 +756,9 @@ internal static async Task ListSamlProviderConfigs()
756756
};
757757
IAsyncEnumerator<SamlProviderConfig> enumerator = FirebaseAuth.DefaultInstance
758758
.ListSamlProviderConfigsAsync(listOptions)
759-
.GetEnumerator();
759+
.GetAsyncEnumerator();
760760

761-
while (await enumerator.MoveNext())
761+
while (await enumerator.MoveNextAsync())
762762
{
763763
SamlProviderConfig saml = enumerator.Current;
764764
Console.WriteLine(saml.ProviderId);
@@ -826,9 +826,9 @@ internal static async Task ListOidcProviderConfigs()
826826
};
827827
IAsyncEnumerator<OidcProviderConfig> enumerator = FirebaseAuth.DefaultInstance
828828
.ListOidcProviderConfigsAsync(listOptions)
829-
.GetEnumerator();
829+
.GetAsyncEnumerator();
830830

831-
while (await enumerator.MoveNext())
831+
while (await enumerator.MoveNextAsync())
832832
{
833833
OidcProviderConfig oidc = enumerator.Current;
834834
Console.WriteLine(oidc.ProviderId);

FirebaseAdmin/FirebaseAdmin.Tests/Auth/FirebaseAuthTest.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,6 @@
1313
// limitations under the License.
1414

1515
using System;
16-
using System.Collections.Generic;
17-
using System.Text;
18-
using System.Threading.Tasks;
1916
using FirebaseAdmin.Auth.Jwt;
2017
using Google.Apis.Auth.OAuth2;
2118
using Xunit;

0 commit comments

Comments
 (0)