Skip to content

Commit 7fb0d3a

Browse files
Merge branch 'main' into dependabot/nuget/Src/Notion.Client/Newtonsoft.Json-13.0.2
2 parents 36efddc + 6ed7cbb commit 7fb0d3a

File tree

6 files changed

+208
-117
lines changed

6 files changed

+208
-117
lines changed
Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
1-
using Newtonsoft.Json;
1+
using System.Collections.Generic;
2+
using Newtonsoft.Json;
23

34
namespace Notion.Client
45
{
56
public class TableBlock : Block, IColumnChildrenBlock, INonColumnBlock
67
{
78
[JsonProperty("table")]
8-
public TableInfo Table { get; set; }
9+
public Info Table { get; set; }
910

1011
public override BlockType Type => BlockType.Table;
1112

12-
public class TableInfo
13+
public class Info
1314
{
1415
[JsonProperty("table_width")]
1516
public int TableWidth { get; set; }
@@ -21,7 +22,7 @@ public class TableInfo
2122
public bool HasRowHeader { get; set; }
2223

2324
[JsonProperty("children")]
24-
public TableRowBlock Children { get; set; }
25+
public IEnumerable<TableRowBlock> Children { get; set; }
2526
}
2627
}
2728
}

Test/Notion.IntegrationTests/CommentsClientTests.cs

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,30 +7,22 @@
77

88
namespace Notion.IntegrationTests;
99

10-
public class CommentsClientTests : IDisposable
10+
public class CommentsClientTests : IntegrationTestBase, IDisposable
1111
{
12-
private readonly INotionClient _client;
1312
private readonly Page _page;
1413

1514
public CommentsClientTests()
1615
{
17-
var options = new ClientOptions { AuthToken = Environment.GetEnvironmentVariable("NOTION_AUTH_TOKEN") };
18-
19-
_client = NotionClientFactory.Create(options);
20-
21-
var pageParentId = Environment.GetEnvironmentVariable("NOTION_PAGE_PARENT_ID") ??
22-
throw new InvalidOperationException("Page parent id is required.");
23-
24-
_page = _client.Pages.CreateAsync(
16+
_page = Client.Pages.CreateAsync(
2517
PagesCreateParametersBuilder.Create(
26-
new ParentPageInput { PageId = pageParentId }
18+
new ParentPageInput { PageId = ParentPageId }
2719
).Build()
2820
).Result;
2921
}
3022

3123
public void Dispose()
3224
{
33-
_client.Pages.UpdateAsync(_page.Id, new PagesUpdateParameters { Archived = true }).Wait();
25+
Client.Pages.UpdateAsync(_page.Id, new PagesUpdateParameters { Archived = true }).Wait();
3426
}
3527

3628
[Fact]
@@ -43,7 +35,7 @@ public async Task ShouldCreatePageComment()
4335
);
4436

4537
// Act
46-
var response = await _client.Comments.CreateAsync(parameters);
38+
var response = await Client.Comments.CreateAsync(parameters);
4739

4840
// Arrange
4941

@@ -64,7 +56,7 @@ public async Task ShouldCreatePageComment()
6456
public async Task ShouldCreateADiscussionComment()
6557
{
6658
// Arrange
67-
var comment = await _client.Comments.CreateAsync(
59+
var comment = await Client.Comments.CreateAsync(
6860
CreateCommentParameters.CreatePageComment(
6961
new ParentPageInput { PageId = _page.Id },
7062
new List<RichTextBaseInput>
@@ -75,7 +67,7 @@ public async Task ShouldCreateADiscussionComment()
7567
);
7668

7769
// Act
78-
var response = await _client.Comments.CreateAsync(
70+
var response = await Client.Comments.CreateAsync(
7971
CreateCommentParameters.CreateDiscussionComment(
8072
comment.DiscussionId,
8173
new List<RichTextBaseInput>

0 commit comments

Comments
 (0)