From a7eef157a91a015591276da01e18c45d18b6992a Mon Sep 17 00:00:00 2001 From: Vedant Koditkar Date: Sun, 21 Aug 2022 00:17:43 +0530 Subject: [PATCH] Fix broken integration tests --- Test/Notion.IntegrationTests/IPageClientTests.cs | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/Test/Notion.IntegrationTests/IPageClientTests.cs b/Test/Notion.IntegrationTests/IPageClientTests.cs index a2c73162..c1d78635 100644 --- a/Test/Notion.IntegrationTests/IPageClientTests.cs +++ b/Test/Notion.IntegrationTests/IPageClientTests.cs @@ -142,7 +142,7 @@ public async Task Test_RetrievePagePropertyItemAsync() var listProperty = (ListPropertyItem)property; - listProperty.Type.Should().BeNull(); + listProperty.Type.Should().NotBeNull(); listProperty.Results.Should().SatisfyRespectively(p => { p.Should().BeOfType(); @@ -202,7 +202,11 @@ public async Task Test_UpdatePageProperty_with_date_as_null() var page = await _client.Pages.CreateAsync(pagesCreateParameters); - var setDate = page.Properties[datePropertyName] as DatePropertyValue; + var setDate = (DatePropertyItem)await _client.Pages.RetrievePagePropertyItem(new RetrievePropertyItemParameters + { + PageId = page.Id, + PropertyId = page.Properties[datePropertyName].Id + }); setDate?.Date?.Start.Should().Be(Convert.ToDateTime("2020-12-08T12:00:00Z")); @@ -215,7 +219,11 @@ public async Task Test_UpdatePageProperty_with_date_as_null() Properties = testProps }); - var verifyDate = updatedPage.Properties[datePropertyName] as DatePropertyValue; + var verifyDate = (DatePropertyItem)await _client.Pages.RetrievePagePropertyItem(new RetrievePropertyItemParameters + { + PageId = page.Id, + PropertyId = updatedPage.Properties[datePropertyName].Id + }); verifyDate?.Date.Should().BeNull();