Skip to content

Commit

Permalink
fixed insight model
Browse files Browse the repository at this point in the history
  • Loading branch information
10hic31 committed Aug 1, 2023
1 parent 34fc2a5 commit 27e8200
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 41 deletions.
9 changes: 6 additions & 3 deletions Src/LineDevelopers.Tests/LineInsightClientTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ await _client.Message.SendBroadcastMessageAsync(new TextMessage("static test"),
}
});
await Task.Delay(1000);
await Task.Delay(10000);
var result = await _client.Insight.GetUserInteractionStatisticsAsync(requestId);
That(result.Overview.RequestId, Is.EqualTo(requestId));
That(result.Overview.RequestId, Is.EqualTo(requestId),$"err : {result.Overview.RequestId} : {requestId}");
});
}

Expand All @@ -57,10 +57,13 @@ public void GetStatisticsPerUnitAsyncTest()
{
DoesNotThrowAsync(async () =>
{
await _client.Insight.GetStatisticsPerUnitAsync("DUMMY", new DateOnly(2023, 04, 01), new DateOnly(2023, 04, 10));
var result = await _client.Insight.GetStatisticsPerUnitAsync("Promotion_TEST", new DateOnly(2023, 7, 31), new DateOnly(2023, 7, 31));
That(result.Messages.Count, Is.EqualTo(2));
});
}


[Test]
public void GetNumberOfFollowersAsyncTest()
{
Expand Down
4 changes: 0 additions & 4 deletions Src/LineDevelopers/LineDevelopers.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,4 @@
</None>
</ItemGroup>

<ItemGroup>
<Folder Include="Message\Content\" />
</ItemGroup>

</Project>
11 changes: 0 additions & 11 deletions Src/LineDevelopers/LineHttpClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -115,17 +115,6 @@ protected async Task<Stream> GetStreamAsync(string endpoint, Action<HttpResponse
return await response.Content?.ReadAsStreamAsync();
}

protected async Task<Stream> GetStreamAsync(string endpoint, Action<HttpContentHeaders,HttpResponseHeaders>? getResponseHeaders = null)
{
var response = await _httpClient.GetAsync(endpoint).ConfigureAwait(false);

if (getResponseHeaders != null) getResponseHeaders(response.Content.Headers, response.Headers);

await this.EnsureSuccessStatusCodeAsync(response).ConfigureAwait(false);

return await response.Content?.ReadAsStreamAsync();
}

protected async Task PostAsync(string endpoint, StreamContent streamContent, MediaType mediaType, Action<HttpResponseHeaders>? getResponseHeaders = null)
{
using (var request = new HttpRequestMessage(HttpMethod.Post, endpoint))
Expand Down
3 changes: 2 additions & 1 deletion Src/LineDevelopers/Message/Insights/StatisticsMessage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ public class StatisticsMessage
public int Seq { get; set; }

[JsonPropertyName("impression")]
public int Impression { get; set; }
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public int? Impression { get; set; }

[JsonPropertyName("mediaPlayed")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
Expand Down
22 changes: 0 additions & 22 deletions Src/LineDevelopers/Message/LineContentClient.cs

This file was deleted.

0 comments on commit 27e8200

Please sign in to comment.