@@ -88,6 +88,7 @@ public async Task CreateAsync()
88
88
public async Task UpdatePropertiesAsync ( )
89
89
{
90
90
var pageId = "251d2b5f-268c-4de2-afe9-c71ff92ca95c" ;
91
+ var propertyId = "{>U;" ;
91
92
var path = ApiEndpoints . PagesApiUrls . UpdateProperties ( pageId ) ;
92
93
93
94
var jsonData = await File . ReadAllTextAsync ( "data/pages/UpdatePagePropertiesResponse.json" ) ;
@@ -99,6 +100,10 @@ public async Task UpdatePropertiesAsync()
99
100
. WithBody ( jsonData )
100
101
) ;
101
102
103
+ Server . Given ( CreateGetRequestBuilder ( ApiEndpoints . PagesApiUrls . RetrievePropertyItem ( pageId , propertyId ) ) )
104
+ . RespondWith (
105
+ Response . Create ( ) . WithStatusCode ( 200 ) . WithBody ( "{\" object\" :\" property_item\" ,\" id\" :\" {>U;\" ,\" type\" :\" checkbox\" ,\" checkbox\" :true}" ) ) ;
106
+
102
107
var updatedProperties = new Dictionary < string , PropertyValue > ( )
103
108
{
104
109
{ "In stock" , new CheckboxPropertyValue ( ) { Checkbox = true } }
@@ -109,7 +114,14 @@ public async Task UpdatePropertiesAsync()
109
114
page . Id . Should ( ) . Be ( pageId ) ;
110
115
page . Properties . Should ( ) . HaveCount ( 2 ) ;
111
116
var updatedProperty = page . Properties . First ( x => x . Key == "In stock" ) ;
112
- ( ( CheckboxPropertyValue ) updatedProperty . Value ) . Checkbox . Should ( ) . BeTrue ( ) ;
117
+
118
+ var checkboxPropertyValue = ( CheckboxPropertyItem ) await _client . RetrievePagePropertyItem ( new RetrievePropertyItemParameters
119
+ {
120
+ PageId = page . Id ,
121
+ PropertyId = updatedProperty . Value . Id
122
+ } ) ;
123
+
124
+ checkboxPropertyValue . Checkbox . Should ( ) . BeTrue ( ) ;
113
125
}
114
126
115
127
[ Fact ]
@@ -135,6 +147,7 @@ public async Task PageObjectShouldHaveUrlProperty()
135
147
public async Task UpdatePageAsync ( )
136
148
{
137
149
var pageId = "251d2b5f-268c-4de2-afe9-c71ff92ca95c" ;
150
+ var propertyId = "{>U;" ;
138
151
var path = ApiEndpoints . PagesApiUrls . UpdateProperties ( pageId ) ;
139
152
140
153
var jsonData = await File . ReadAllTextAsync ( "data/pages/UpdatePagePropertiesResponse.json" ) ;
@@ -146,6 +159,10 @@ public async Task UpdatePageAsync()
146
159
. WithBody ( jsonData )
147
160
) ;
148
161
162
+ Server . Given ( CreateGetRequestBuilder ( ApiEndpoints . PagesApiUrls . RetrievePropertyItem ( pageId , propertyId ) ) )
163
+ . RespondWith (
164
+ Response . Create ( ) . WithStatusCode ( 200 ) . WithBody ( "{\" object\" :\" property_item\" ,\" id\" :\" {>U;\" ,\" type\" :\" checkbox\" ,\" checkbox\" :true}" ) ) ;
165
+
149
166
var pagesUpdateParameters = new PagesUpdateParameters
150
167
{
151
168
Properties = new Dictionary < string , PropertyValue > ( )
@@ -160,13 +177,22 @@ public async Task UpdatePageAsync()
160
177
page . IsArchived . Should ( ) . BeFalse ( ) ;
161
178
page . Properties . Should ( ) . HaveCount ( 2 ) ;
162
179
var updatedProperty = page . Properties . First ( x => x . Key == "In stock" ) ;
163
- ( ( CheckboxPropertyValue ) updatedProperty . Value ) . Checkbox . Should ( ) . BeTrue ( ) ;
180
+
181
+ var checkboxPropertyValue = ( CheckboxPropertyItem ) await _client . RetrievePagePropertyItem ( new RetrievePropertyItemParameters
182
+ {
183
+ PageId = page . Id ,
184
+ PropertyId = updatedProperty . Value . Id
185
+ } ) ;
186
+
187
+ checkboxPropertyValue . Checkbox . Should ( ) . BeTrue ( ) ;
164
188
}
165
189
166
190
[ Fact ]
167
191
public async Task ArchivePageAsync ( )
168
192
{
169
193
var pageId = "251d2b5f-268c-4de2-afe9-c71ff92ca95c" ;
194
+ var propertyId = "{>U;" ;
195
+
170
196
var path = ApiEndpoints . PagesApiUrls . UpdateProperties ( pageId ) ;
171
197
172
198
var jsonData = await File . ReadAllTextAsync ( "data/pages/ArchivePageResponse.json" ) ;
@@ -178,6 +204,10 @@ public async Task ArchivePageAsync()
178
204
. WithBody ( jsonData )
179
205
) ;
180
206
207
+ Server . Given ( CreateGetRequestBuilder ( ApiEndpoints . PagesApiUrls . RetrievePropertyItem ( pageId , propertyId ) ) )
208
+ . RespondWith (
209
+ Response . Create ( ) . WithStatusCode ( 200 ) . WithBody ( "{\" object\" :\" property_item\" ,\" id\" :\" {>U;\" ,\" type\" :\" checkbox\" ,\" checkbox\" :true}" ) ) ;
210
+
181
211
var pagesUpdateParameters = new PagesUpdateParameters
182
212
{
183
213
Archived = true ,
@@ -193,7 +223,14 @@ public async Task ArchivePageAsync()
193
223
page . IsArchived . Should ( ) . BeTrue ( ) ;
194
224
page . Properties . Should ( ) . HaveCount ( 2 ) ;
195
225
var updatedProperty = page . Properties . First ( x => x . Key == "In stock" ) ;
196
- ( ( CheckboxPropertyValue ) updatedProperty . Value ) . Checkbox . Should ( ) . BeTrue ( ) ;
226
+
227
+ var checkboxPropertyValue = ( CheckboxPropertyItem ) await _client . RetrievePagePropertyItem ( new RetrievePropertyItemParameters
228
+ {
229
+ PageId = page . Id ,
230
+ PropertyId = updatedProperty . Value . Id
231
+ } ) ;
232
+
233
+ checkboxPropertyValue . Checkbox . Should ( ) . BeTrue ( ) ;
197
234
}
198
235
199
236
[ Fact ]
0 commit comments