Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Run dotnet format
  • Loading branch information
KoditkarVedant committed Sep 16, 2023
commit 2c2b9f3404497fef17ca7cd5a8d18d882932ba44
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,6 @@ public enum PropertyType
Status,

[EnumMember(Value = "unique_id")]
UniqueId,
UniqueId,
}
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
using System;
using System.Collections.Generic;
using System.Collections.Generic;
using Newtonsoft.Json;

namespace Notion.Client
{
{
public class UniqueIdProperty : Property
{
public override PropertyType Type => PropertyType.UniqueId;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System;
using Newtonsoft.Json;
using Newtonsoft.Json;

namespace Notion.Client
{
Expand Down
16 changes: 8 additions & 8 deletions Test/Notion.IntegrationTests/IBlocksClientTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ private static IEnumerable<object[]> BlockData()
new Action<IBlock, INotionClient>((block, client) =>
{
block.Should().NotBeNull();

block.Should().BeOfType<AudioBlock>().Subject
.Audio.Should().BeOfType<ExternalFile>().Subject
.External.Url.Should().Be("https://www.soundhelix.com/examples/mp3/SoundHelix-Song-3.mp3");
Expand Down Expand Up @@ -252,7 +252,7 @@ private static IEnumerable<object[]> BlockData()
{
Assert.NotNull(block);
var calloutBlock = Assert.IsType<CalloutBlock>(block);

Assert.Equal("Test 2", calloutBlock.Callout.RichText.OfType<RichTextText>().First().Text.Content);
})
},
Expand Down Expand Up @@ -282,7 +282,7 @@ private static IEnumerable<object[]> BlockData()
{
Assert.NotNull(block);
var quoteBlock = Assert.IsType<QuoteBlock>(block);

Assert.Equal("Test 2", quoteBlock.Quote.RichText.OfType<RichTextText>().First().Text.Content);
})
},
Expand Down Expand Up @@ -314,7 +314,7 @@ private static IEnumerable<object[]> BlockData()
Assert.NotNull(block);
var imageBlock = Assert.IsType<ImageBlock>(block);
var imageFile = Assert.IsType<ExternalFile>(imageBlock.Image);

Assert.Equal("https://www.iaspaper.net/wp-content/uploads/2017/09/TNEA-Online-Application.jpg",
imageFile.External.Url);
})
Expand All @@ -339,7 +339,7 @@ private static IEnumerable<object[]> BlockData()
{
Assert.NotNull(block);
var embedBlock = Assert.IsType<EmbedBlock>(block);

Assert.Equal("https://www.iaspaper.net/wp-content/uploads/2017/09/TNEA-Online-Application.jpg",
embedBlock.Embed.Url);
})
Expand Down Expand Up @@ -381,10 +381,10 @@ private static IEnumerable<object[]> BlockData()
{
Assert.NotNull(block);
var templateBlock = Assert.IsType<TemplateBlock>(block);

Assert.Single(templateBlock.Template.RichText);
Assert.Null(templateBlock.Template.Children);

Assert.Equal("Test Template 2",
templateBlock.Template.RichText.OfType<RichTextText>().First().Text.Content);
})
Expand All @@ -407,7 +407,7 @@ private static IEnumerable<object[]> BlockData()
{
Assert.NotNull(block);
var linkToPageBlock = Assert.IsType<LinkToPageBlock>(block);

var pageParent = Assert.IsType<PageParent>(linkToPageBlock.LinkToPage);

// TODO: Currently the api doesn't allow to update the link_to_page block type
Expand Down
4 changes: 2 additions & 2 deletions Test/Notion.IntegrationTests/IPageClientTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -330,11 +330,11 @@ public async Task Bug_exception_when_attempting_to_set_select_property_to_nothin
};

var updatedPage = await Client.Pages.UpdateAsync(page.Id, updatePageRequest);

// Assert
page.Properties["Colors1"].As<SelectPropertyValue>().Select.Name.Should().Be("Red");
page.Properties["Colors2"].As<SelectPropertyValue>().Select.Name.Should().Be("Green");

updatedPage.Properties["Colors1"].As<SelectPropertyValue>().Select.Name.Should().Be("Blue");
updatedPage.Properties["Colors2"].As<SelectPropertyValue>().Select.Should().BeNull();

Expand Down