Skip to content

Commit c552865

Browse files
committed
Fixing a build error in tests
1 parent 43bdc3c commit c552865

File tree

3 files changed

+15
-6
lines changed

3 files changed

+15
-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 behinh 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: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,14 +60,18 @@ 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, ProjectId = "test-project",
74+
});
7175
FirebaseMessaging messaging = FirebaseMessaging.GetMessaging(app);
7276
Assert.NotNull(messaging);
7377
Assert.Same(messaging, FirebaseMessaging.GetMessaging(app));
@@ -101,7 +105,11 @@ await Assert.ThrowsAsync<OperationCanceledException>(
101105
[Fact]
102106
public async Task SendMessageCancelWithClientFactory()
103107
{
104-
FirebaseApp.Create(new AppOptions() { Credential = MockCredential, HttpClientFactory = new HttpClientFactory() });
108+
FirebaseApp.Create(new AppOptions()
109+
{
110+
Credential = MockCredential,
111+
HttpClientFactory = new HttpClientFactory(),
112+
});
105113
var canceller = new CancellationTokenSource();
106114
canceller.Cancel();
107115
await Assert.ThrowsAsync<OperationCanceledException>(

0 commit comments

Comments
 (0)