Skip to content

Commit 3bb969c

Browse files
Merge branch 'main' into bugfix/191-register-the-block-sub-type
2 parents a93f0fe + 139d68e commit 3bb969c

File tree

2 files changed

+35
-0
lines changed

2 files changed

+35
-0
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
using Newtonsoft.Json;
2+
3+
namespace Notion.Client
4+
{
5+
public class EquationUpdateBlock : UpdateBlock, IUpdateBlock
6+
{
7+
[JsonProperty("equation")]
8+
public Data Equation { get; set; }
9+
10+
public class Data
11+
{
12+
[JsonProperty("expression")]
13+
public string Expression { get; set; }
14+
}
15+
}
16+
}

Test/Notion.IntegrationTests/IBlocksClientTests.cs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,25 @@ private static IEnumerable<object[]> BlockData()
240240
Assert.Equal("Github", updatedBlock.Bookmark.Caption.OfType<RichTextText>().First().Text.Content);
241241
})
242242
},
243+
new object[] {
244+
new EquationBlock
245+
{
246+
Equation = new EquationBlock.Info
247+
{
248+
Expression = "e=mc^3"
249+
}
250+
},
251+
new EquationUpdateBlock {
252+
Equation = new EquationUpdateBlock.Data
253+
{
254+
Expression = "e=mc^2"
255+
}
256+
},
257+
new Action<Block>((block) => {
258+
var updatedBlock = (EquationBlock)block;
259+
Assert.Equal("e=mc^2", updatedBlock.Equation.Expression);
260+
})
261+
},
243262
new object[] {
244263
new DividerBlock {
245264
Divider = new DividerBlock.Data()

0 commit comments

Comments
 (0)