Skip to content

Commit f6e8feb

Browse files
User IAsyncLifeTIme in DatabasesClient tests
1 parent 88135e4 commit f6e8feb

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

Test/Notion.IntegrationTests/DatabasesClientTests.cs

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
using System;
2-
using System.Collections.Generic;
1+
using System.Collections.Generic;
32
using System.Linq;
43
using System.Threading.Tasks;
54
using FluentAssertions;
@@ -8,20 +7,20 @@
87

98
namespace Notion.IntegrationTests;
109

11-
public class DatabasesClientTests : IntegrationTestBase, IAsyncDisposable
10+
public class DatabasesClientTests : IntegrationTestBase, IAsyncLifetime
1211
{
13-
private readonly Page _page;
12+
private Page _page = null!;
1413

15-
public DatabasesClientTests()
14+
public async Task InitializeAsync()
1615
{
17-
_page = Client.Pages.CreateAsync(
16+
_page = await Client.Pages.CreateAsync(
1817
PagesCreateParametersBuilder.Create(
1918
new ParentPageInput { PageId = ParentPageId }
2019
).Build()
21-
).GetAwaiter().GetResult();
20+
);
2221
}
2322

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

0 commit comments

Comments
 (0)