Skip to content

Commit 88135e4

Browse files
Use IAsyncLifetime in CommentsClient Tests
1 parent c79531a commit 88135e4

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

Test/Notion.IntegrationTests/CommentsClientTests.cs

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,25 @@
1-
using System;
2-
using System.Collections.Generic;
1+
using System.Collections.Generic;
32
using System.Linq;
43
using System.Threading.Tasks;
54
using Notion.Client;
65
using Xunit;
76

87
namespace Notion.IntegrationTests;
98

10-
public class CommentsClientTests : IntegrationTestBase, IAsyncDisposable
9+
public class CommentsClientTests : IntegrationTestBase, IAsyncLifetime
1110
{
12-
private readonly Page _page;
11+
private Page _page = null!;
1312

14-
public CommentsClientTests()
13+
public async Task InitializeAsync()
1514
{
16-
_page = Client.Pages.CreateAsync(
15+
_page = await Client.Pages.CreateAsync(
1716
PagesCreateParametersBuilder.Create(
1817
new ParentPageInput { PageId = ParentPageId }
1918
).Build()
20-
).GetAwaiter().GetResult();
19+
);
2120
}
2221

23-
public async ValueTask DisposeAsync()
22+
public async Task DisposeAsync()
2423
{
2524
await Client.Pages.UpdateAsync(_page.Id, new PagesUpdateParameters { Archived = true });
2625
}

0 commit comments

Comments
 (0)