File tree Expand file tree Collapse file tree 1 file changed +10
-11
lines changed
Test/Notion.IntegrationTests Expand file tree Collapse file tree 1 file changed +10
-11
lines changed Original file line number Diff line number Diff line change 1- using System ;
2- using System . Collections . Generic ;
1+ using System . Collections . Generic ;
32using System . Linq ;
43using System . Threading . Tasks ;
54using FluentAssertions ;
87
98namespace Notion . IntegrationTests ;
109
11- public class PageWithPageParentTests : IntegrationTestBase , IAsyncDisposable
10+ public class PageWithPageParentTests : IntegrationTestBase , IAsyncLifetime
1211{
13- private readonly Page _page ;
12+ private Page _page = null ! ;
1413
15- public PageWithPageParentTests ( )
14+ public async Task InitializeAsync ( )
1615 {
1716 var pagesCreateParameters = PagesCreateParametersBuilder
1817 . Create ( new ParentPageInput ( ) { PageId = ParentPageId } )
@@ -25,7 +24,12 @@ public PageWithPageParentTests()
2524 }
2625 } ) . Build ( ) ;
2726
28- _page = Client . Pages . CreateAsync ( pagesCreateParameters ) . GetAwaiter ( ) . GetResult ( ) ;
27+ _page = await Client . Pages . CreateAsync ( pagesCreateParameters ) ;
28+ }
29+
30+ public async Task DisposeAsync ( )
31+ {
32+ await Client . Pages . UpdateAsync ( _page . Id , new PagesUpdateParameters { Archived = true } ) ;
2933 }
3034
3135 [ Fact ]
@@ -63,9 +67,4 @@ public async Task Update_Title_Of_Page()
6367
6468 titleProperty . Results . First ( ) . As < TitlePropertyItem > ( ) . Title . PlainText . Should ( ) . Be ( "Page Title Updated" ) ;
6569 }
66-
67- public async ValueTask DisposeAsync ( )
68- {
69- await Client . Pages . UpdateAsync ( _page . Id , new PagesUpdateParameters { Archived = true } ) ;
70- }
7170}
You can’t perform that action at this time.
0 commit comments