-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #162 from notion-dotnet/bfix/161-fix-IPageIcon-par…
…sing Fix IPageIcon parsing 🐛
- Loading branch information
Showing
4 changed files
with
61 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
using FluentAssertions; | ||
using Notion.Client; | ||
|
||
namespace Notion.UnitTests | ||
{ | ||
public static class HelperAsserts | ||
{ | ||
public static void IPageIconAsserts(IPageIcon icon) | ||
{ | ||
icon.Should().NotBeNull(); | ||
|
||
switch (icon) | ||
{ | ||
case EmojiObject emoji: | ||
emoji.Emoji.Should().NotBeNull(); | ||
break; | ||
case FileObject fileObject: | ||
FileObjectAsserts(fileObject); | ||
break; | ||
} | ||
} | ||
|
||
public static void FileObjectAsserts(FileObject fileObject) | ||
{ | ||
fileObject.Should().NotBeNull(); | ||
|
||
switch (fileObject) | ||
{ | ||
case UploadedFile uploadedFile: | ||
uploadedFile.File.Should().NotBeNull(); | ||
uploadedFile.File.Url.Should().NotBeNull(); | ||
uploadedFile.File.ExpiryTime.Should().NotBeSameDateAs(default); | ||
break; | ||
case ExternalFile externalFile: | ||
externalFile.External.Should().NotBeNull(); | ||
externalFile.External.Url.Should().NotBeNull(); | ||
break; | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters