Skip to content

Commit 89547e7

Browse files
cleanup of old solution fragments
1 parent c932fe7 commit 89547e7

File tree

3 files changed

+0
-123
lines changed

3 files changed

+0
-123
lines changed

FirebaseAdmin/FirebaseAdmin.Tests/Auth/FirebaseUserManagerTest.cs

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -72,40 +72,6 @@ public void TooLargeClaimsPayload()
7272
Assert.Throws<ArgumentException>(() => new UserRecord("user1") { CustomClaims = customClaims });
7373
}
7474

75-
[Fact]
76-
public async Task GetUserList()
77-
{
78-
const string nextPageToken = "4711";
79-
var handler = new MockMessageHandler()
80-
{
81-
Response = new DownloadAccountResponse()
82-
{
83-
NextPageToken = nextPageToken,
84-
Users = new List<GetAccountInfoResponse.User>()
85-
{
86-
new GetAccountInfoResponse.User() { UserId = "user1" },
87-
new GetAccountInfoResponse.User() { UserId = "user2" },
88-
new GetAccountInfoResponse.User() { UserId = "user3" },
89-
},
90-
},
91-
};
92-
93-
var factory = new MockHttpClientFactory(handler);
94-
var userManager = new FirebaseUserManager(
95-
new FirebaseUserManagerArgs
96-
{
97-
Credential = MockCredential,
98-
ProjectId = MockProjectId,
99-
ClientFactory = factory,
100-
});
101-
102-
var userRecords = await userManager.ListUsers(1000, string.Empty);
103-
Assert.Equal("user1", userRecords.Users[0].UserId);
104-
Assert.Equal("user2", userRecords.Users[1].UserId);
105-
Assert.Equal("user3", userRecords.Users[2].UserId);
106-
Assert.Equal(nextPageToken, userRecords.NextPageToken);
107-
}
108-
10975
[Fact]
11076
public async Task GetUserById()
11177
{

FirebaseAdmin/FirebaseAdmin/Auth/FirebaseUserManager.cs

Lines changed: 0 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -105,31 +105,6 @@ public UserRecordServiceRequest CreateUserRecordServiceRequest(UserRecordService
105105
return new UserRecordServiceRequest(this.baseUrl, this.httpClient, requestOptions);
106106
}
107107

108-
/// <summary>
109-
/// Gets a page of users starting from the specified <paramref name="pageToken"/>. Page size will be limited to <paramref name="maxResults"/> users.
110-
/// </summary>
111-
/// <param name="maxResults">Maximum number of users to include in the returned page. This may not exceed 1000.</param>
112-
/// <param name="pageToken">A non-empty page token string, or null to retrieve the first page of users.</param>
113-
/// <param name="cancellationToken">A cancellation token to monitor the asynchronous operation.</param>
114-
/// <returns>A <see cref="DownloadAccountResponse"/> instance.</returns>
115-
public async Task<DownloadAccountResponse> ListUsers(int maxResults, string pageToken, CancellationToken cancellationToken = default(CancellationToken))
116-
{
117-
const string listUsersPath = "accounts:batchGet";
118-
var payload = new Dictionary<string, object>()
119-
{
120-
{ "maxResults", maxResults },
121-
{ "nextPageToken", pageToken },
122-
};
123-
var response = await this.GetAndDeserializeAsync<DownloadAccountResponse>(
124-
listUsersPath, payload, cancellationToken).ConfigureAwait(false);
125-
if (response == null)
126-
{
127-
throw new FirebaseException($"Failed to list users");
128-
}
129-
130-
return response;
131-
}
132-
133108
/// <summary>
134109
/// Update an existing user.
135110
/// </summary>
@@ -187,13 +162,6 @@ public void Dispose()
187162
this.httpClient.Dispose();
188163
}
189164

190-
private async Task<TResult> GetAndDeserializeAsync<TResult>(
191-
string path, Dictionary<string, object> parameters, CancellationToken cancellationToken)
192-
{
193-
var json = await this.GetAsync(path, parameters, cancellationToken).ConfigureAwait(false);
194-
return this.SafeDeserialize<TResult>(json);
195-
}
196-
197165
private async Task<TResult> PostAndDeserializeAsync<TResult>(
198166
string path, object body, CancellationToken cancellationToken)
199167
{
@@ -213,19 +181,6 @@ private TResult SafeDeserialize<TResult>(string json)
213181
}
214182
}
215183

216-
private async Task<string> GetAsync(
217-
string path, Dictionary<string, object> parameters, CancellationToken cancellationToken)
218-
{
219-
var queryParameters = string.Join("&", parameters.Select(kvp => $"{kvp.Key}={kvp.Value}"));
220-
221-
var request = new HttpRequestMessage()
222-
{
223-
Method = HttpMethod.Get,
224-
RequestUri = new Uri($"{this.baseUrl}/{path}?{queryParameters}"),
225-
};
226-
return await this.SendAsync(request, cancellationToken).ConfigureAwait(false);
227-
}
228-
229184
private async Task<string> PostAsync(
230185
string path, object body, CancellationToken cancellationToken)
231186
{

FirebaseAdmin/FirebaseAdmin/Auth/ISource.cs

Lines changed: 0 additions & 44 deletions
This file was deleted.

0 commit comments

Comments
 (0)