@@ -15,49 +15,11 @@ Describe "notion_table_block Tests" {
1515 $mut = Import-Module - Name " $script :projectPath /output/module/$ProjectName /$script :version /$ProjectName .psd1" - Force - ErrorAction Stop - PassThru
1616 }
1717
18- Context " Table_structure Constructors" {
19- It " should create default Table_structure" {
20- $table = [Table _structure ]::new()
21- $table.table_width | Should - Be 0
22- $table.has_column_header | Should - BeFalse
23- $table.has_row_header | Should - BeFalse
24- $table.children | Should - BeNullOrEmpty
25- }
26-
27- It " should create Table_structure with width" {
28- $table = [Table _structure ]::new(3 )
29- $table.table_width | Should - Be 3
30- }
31-
32- It " should create Table_structure with width and headers" {
33- $table = [Table _structure ]::new(4 , $true , $true )
34- $table.table_width | Should - Be 4
35- $table.has_column_header | Should - BeTrue
36- $table.has_row_header | Should - BeTrue
37- }
38- }
39-
40- Context " Table_structure Methods" {
41- It " should add a single row" {
42- $table = [Table _structure ]::new()
43- $row = [notion _table _row _block ]::new()
44- $table.addRow ($row )
45- $table.children.Count | Should - Be 1
46- }
47-
48- It " should add multiple rows" {
49- $table = [Table _structure ]::new()
50- $rows = @ ([notion _table _row _block ]::new(), [notion _table _row _block ]::new())
51- $table.addRows ($rows )
52- $table.children.Count | Should - Be 2
53- }
54- }
55-
5618 Context " notion_table_block Constructors" {
5719 It " should create default notion_table_block" {
5820 $block = [notion _table _block ]::new()
5921 $block.type | Should - Be " table"
60- $block.table | Should - BeOfType " Table_structure"
22+ $block.table.gettype ().Name | Should - Be " Table_structure"
6123 }
6224
6325 It " should create notion_table_block with rows" {
@@ -86,14 +48,14 @@ Describe "notion_table_block Tests" {
8648
8749 Context " ConvertFromObject Tests" {
8850 It " should convert from object correctly" {
89- $mock = [PSCustomObject ]@ {
51+ $object = [PSCustomObject ]@ {
9052 table = [PSCustomObject ]@ {
9153 table_width = 3
9254 has_column_header = $true
9355 has_row_header = $false
9456 }
9557 }
96- $block = [notion _table _block ]::ConvertFromObject($mock )
58+ $block = [notion _table _block ]::ConvertFromObject($object )
9759 $block | Should - BeOfType " notion_table_block"
9860 $block.table.table_width | Should - Be 3
9961 $block.table.has_column_header | Should - BeTrue
0 commit comments