Skip to content

Commit 5e5a7d3

Browse files
authored
Merge pull request #44 from firebase/hkj-fix-build
Fixing a build error in tests
2 parents 43bdc3c + 9023282 commit 5e5a7d3

File tree

3 files changed

+16
-6
lines changed

3 files changed

+16
-6
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Unreleased
22

3-
-
3+
- [added] `AppOptions` now supports setting an `HttpClientFactory`, which
4+
is useful when deploying the SDK behind a proxy server.
45

56
# v1.3.0
67

FirebaseAdmin/FirebaseAdmin.Tests/FirebaseAppTest.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ public void CreateAppOptions()
104104
Assert.Same(credential, copy.Credential);
105105
Assert.Equal("test-project", copy.ProjectId);
106106
Assert.Equal("[email protected]", copy.ServiceAccountId);
107-
Assert.Same(typeof(MockHttpClientFactory), copy.HttpClientFactory.GetType());
107+
Assert.Same(copy.HttpClientFactory, options.HttpClientFactory);
108108
}
109109

110110
[Fact]
@@ -125,7 +125,7 @@ public void CreateAppOptionsNoClientFactory()
125125
Assert.Same(credential, copy.Credential);
126126
Assert.Equal("test-project", copy.ProjectId);
127127
Assert.Equal("[email protected]", copy.ServiceAccountId);
128-
Assert.Same(typeof(HttpClientFactory), copy.HttpClientFactory.GetType());
128+
Assert.Same(copy.HttpClientFactory, options.HttpClientFactory);
129129
}
130130

131131
[Fact]

FirebaseAdmin/FirebaseAdmin.Tests/Messaging/FirebaseMessagingTest.cs

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,14 +60,19 @@ public async Task GetMessagingWithClientFactory()
6060
{
6161
var handler = new MockMessageHandler()
6262
{
63-
Response = new FirebaseMessagingClient.SendResponse()
63+
Response = new FirebaseMessagingClient.SingleMessageResponse()
6464
{
6565
Name = "test-response",
6666
},
6767
};
6868
var factory = new MockHttpClientFactory(handler);
6969

70-
var app = FirebaseApp.Create(new AppOptions() { Credential = GoogleCredential.FromAccessToken("test-token"), HttpClientFactory = factory, ProjectId = "test-project" });
70+
var app = FirebaseApp.Create(new AppOptions()
71+
{
72+
Credential = GoogleCredential.FromAccessToken("test-token"),
73+
HttpClientFactory = factory,
74+
ProjectId = "test-project",
75+
});
7176
FirebaseMessaging messaging = FirebaseMessaging.GetMessaging(app);
7277
Assert.NotNull(messaging);
7378
Assert.Same(messaging, FirebaseMessaging.GetMessaging(app));
@@ -101,7 +106,11 @@ await Assert.ThrowsAsync<OperationCanceledException>(
101106
[Fact]
102107
public async Task SendMessageCancelWithClientFactory()
103108
{
104-
FirebaseApp.Create(new AppOptions() { Credential = MockCredential, HttpClientFactory = new HttpClientFactory() });
109+
FirebaseApp.Create(new AppOptions()
110+
{
111+
Credential = MockCredential,
112+
HttpClientFactory = new HttpClientFactory(),
113+
});
105114
var canceller = new CancellationTokenSource();
106115
canceller.Cancel();
107116
await Assert.ThrowsAsync<OperationCanceledException>(

0 commit comments

Comments
 (0)