Skip to content

Commit a9b3b65

Browse files
authored
Make OthertotalStockholdersEquity nullable (#61)
1 parent cf703ba commit a9b3b65

File tree

3 files changed

+53
-3
lines changed

3 files changed

+53
-3
lines changed

FinancialModelingPrepApi/Core/Http/FinancialModelingPrepHttpClient.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,10 @@ public FinancialModelingPrepHttpClient(HttpClient client, FinancialModelingPrepO
2828
this.options = options ?? throw new ArgumentNullException(nameof(options));
2929
this.rateLimiter = rateLimiter ?? throw new ArgumentNullException(nameof(rateLimiter));
3030
this.logger = logger ?? throw new ArgumentNullException(nameof(logger));
31-
this.jsonSerializerOptions = new JsonSerializerOptions(JsonSerializerDefaults.Web);
31+
this.jsonSerializerOptions = new JsonSerializerOptions(JsonSerializerDefaults.Web)
32+
{
33+
PropertyNameCaseInsensitive = true,
34+
};
3235

3336
if (string.IsNullOrWhiteSpace(this.options.ApiKey))
3437
{

FinancialModelingPrepApi/Model/CompanyValuation/BalanceSheetResponse.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ public class BalanceSheetResponse
134134
public double AccumulatedOtherComprehensiveIncomeLoss { get; set; }
135135

136136
[JsonPropertyName("othertotalStockholdersEquity")]
137-
public double OthertotalStockholdersEquity { get; set; }
137+
public double? OthertotalStockholdersEquity { get; set; }
138138

139139
[JsonPropertyName("totalStockholdersEquity")]
140140
public double TotalStockholdersEquity { get; set; }

Tests/CompanyValuation/CompanyValuationTests.cs

Lines changed: 48 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public async Task GetCompanyProfileTests(string symbol)
4545

4646
[Theory]
4747
[InlineData("AAPL", false)]
48-
[InlineData("BST", true, Skip = "IsFund returns incorrect result")]
48+
// [InlineData("BST", true, Skip = "IsFund returns incorrect result")]
4949
public async Task GetCompanyProfile_IsFund_Tests(string symbol, bool isFund)
5050
{
5151
var result = await api.GetCompanyProfileAsync(symbol);
@@ -141,6 +141,7 @@ public async Task GetEnterpriseValue(string symbol)
141141
[InlineData("O")]
142142
[InlineData("AGS.BR")]
143143
[InlineData("PPL.TO")]
144+
[InlineData("TSLA")]
144145
public async Task GetIncomeStatement(string symbol)
145146
{
146147
var result = await api.GetIncomeStatementAsync(symbol, Period.Annual, 5);
@@ -156,6 +157,22 @@ public async Task GetIncomeStatement(string symbol)
156157
[InlineData("O")]
157158
[InlineData("AGS.BR")]
158159
[InlineData("PPL.TO")]
160+
[InlineData("TSLA")]
161+
public async Task GetIncomeStatementPerQuarter(string symbol)
162+
{
163+
var result = await api.GetIncomeStatementAsync(symbol, Period.Quarter, limit: 10000);
164+
165+
result.AssertNoErrors();
166+
Assert.NotEmpty(result.Data);
167+
Assert.All(result.Data, data => Assert.Equal(symbol, data.Symbol));
168+
}
169+
170+
[Theory]
171+
[InlineData("AAPL")]
172+
[InlineData("O")]
173+
[InlineData("AGS.BR")]
174+
[InlineData("PPL.TO")]
175+
[InlineData("TSLA")]
159176
public async Task GetCashFlowStatement(string symbol)
160177
{
161178
var result = await api.GetCashFlowStatementAsync(symbol, Period.Annual, 5);
@@ -166,12 +183,27 @@ public async Task GetCashFlowStatement(string symbol)
166183
Assert.All(result.Data, data => Assert.Equal(symbol, data.Symbol));
167184
}
168185

186+
[Theory]
187+
[InlineData("AAPL")]
188+
[InlineData("O")]
189+
[InlineData("AGS.BR")]
190+
[InlineData("PPL.TO")]
191+
[InlineData("TSLA")]
192+
public async Task GetCashFlowStatementPerQuarter(string symbol)
193+
{
194+
var result = await api.GetCashFlowStatementAsync(symbol, Period.Quarter, limit: 10000);
195+
196+
result.AssertNoErrors();
197+
Assert.NotEmpty(result.Data);
198+
Assert.All(result.Data, data => Assert.Equal(symbol, data.Symbol));
199+
}
169200

170201
[Theory]
171202
[InlineData("AAPL")]
172203
[InlineData("O")]
173204
[InlineData("AGS.BR")]
174205
[InlineData("PPL.TO")]
206+
[InlineData("TSLA")]
175207
public async Task GetBalanceSheetStatement(string symbol)
176208
{
177209
var result = await api.GetBalanceSheetStatementAsync(symbol, Period.Annual, 5);
@@ -182,6 +214,21 @@ public async Task GetBalanceSheetStatement(string symbol)
182214
Assert.All(result.Data, data => Assert.Equal(symbol, data.Symbol));
183215
}
184216

217+
[Theory]
218+
[InlineData("AAPL")]
219+
[InlineData("O")]
220+
[InlineData("AGS.BR")]
221+
[InlineData("PPL.TO")]
222+
[InlineData("TSLA")]
223+
public async Task GetBalanceSheetStatementPerQuarter(string symbol)
224+
{
225+
var result = await api.GetBalanceSheetStatementAsync(symbol, Period.Quarter, limit: 10000);
226+
227+
result.AssertNoErrors();
228+
Assert.NotEmpty(result.Data);
229+
Assert.All(result.Data, data => Assert.Equal(symbol, data.Symbol));
230+
}
231+
185232
[Fact]
186233
public async Task GetLatestStockNewsAsync()
187234
{

0 commit comments

Comments
 (0)