@@ -45,7 +45,7 @@ class AssetQueryAPITest: XCTestCase {
4545 ( stack. urlSession as? DVR . Session) ? . endRecording ( )
4646 }
4747
48- func test01FindAll_AssetQuery( ) {
48+ func test01FindAll_AssetQuery( ) async {
4949 let networkExpectation = expectation ( description: " Fetch All Assets Test " )
5050 self . getAssetQuery ( ) . locale ( " en-us " ) . find { ( result: Result < ContentstackResponse < AssetModel > , Error > , response: ResponseType ) in
5151 switch result {
@@ -61,10 +61,10 @@ class AssetQueryAPITest: XCTestCase {
6161 }
6262 networkExpectation. fulfill ( )
6363 }
64- wait ( for : [ networkExpectation] , timeout: 5 )
64+ await fulfillment ( of : [ networkExpectation] , timeout: 5 )
6565 }
6666
67- func test02Find_AssetQuery_whereUIDEquals( ) {
67+ func test02Find_AssetQuery_whereUIDEquals( ) async {
6868 let networkExpectation = expectation ( description: " Fetch where UID equals Assets Test " )
6969 self . queryWhere ( . uid, operation: . equals( AssetQueryAPITest . kAssetUID) ) { ( result: Result < ContentstackResponse < AssetModel > , Error > ) in
7070 switch result {
@@ -77,10 +77,10 @@ class AssetQueryAPITest: XCTestCase {
7777 }
7878 networkExpectation. fulfill ( )
7979 }
80- wait ( for : [ networkExpectation] , timeout: 5 )
80+ await fulfillment ( of : [ networkExpectation] , timeout: 5 )
8181 }
8282
83- func test03Find_AssetQuery_whereTitleDNotEquals( ) {
83+ func test03Find_AssetQuery_whereTitleDNotEquals( ) async {
8484 let networkExpectation = expectation ( description: " Fetch where Title equals Assets Test " )
8585 self . queryWhere ( . title, operation: . notEquals( AssetQueryAPITest . kAssetTitle) ) { ( result: Result < ContentstackResponse < AssetModel > , Error > ) in
8686 switch result {
@@ -93,10 +93,10 @@ class AssetQueryAPITest: XCTestCase {
9393 }
9494 networkExpectation. fulfill ( )
9595 }
96- wait ( for : [ networkExpectation] , timeout: 5 )
96+ await fulfillment ( of : [ networkExpectation] , timeout: 5 )
9797 }
9898
99- func test03Find_AssetQuery_whereFileNameEquals( ) {
99+ func test03Find_AssetQuery_whereFileNameEquals( ) async {
100100 let networkExpectation = expectation ( description: " Fetch where Title equals Assets Test " )
101101 self . queryWhere ( . fileName, operation: . notEquals( AssetQueryAPITest . kFileName) ) { ( result: Result < ContentstackResponse < AssetModel > , Error > ) in
102102 switch result {
@@ -109,10 +109,10 @@ class AssetQueryAPITest: XCTestCase {
109109 }
110110 networkExpectation. fulfill ( )
111111 }
112- wait ( for : [ networkExpectation] , timeout: 5 )
112+ await fulfillment ( of : [ networkExpectation] , timeout: 5 )
113113 }
114114
115- func test04Find_AssetQuery_whereFileNameexists( ) {
115+ func test04Find_AssetQuery_whereFileNameexists( ) async {
116116 let networkExpectation = expectation ( description: " Fetch where fileName exists Assets Test " )
117117 self . queryWhere ( . fileName, operation: . exists( true ) ) { ( result: Result < ContentstackResponse < AssetModel > , Error > ) in
118118 switch result {
@@ -123,10 +123,10 @@ class AssetQueryAPITest: XCTestCase {
123123 }
124124 networkExpectation. fulfill ( )
125125 }
126- wait ( for : [ networkExpectation] , timeout: 5 )
126+ await fulfillment ( of : [ networkExpectation] , timeout: 5 )
127127 }
128128
129- func test05Find_AssetQuery_whereTitleMatchRegex( ) {
129+ func test05Find_AssetQuery_whereTitleMatchRegex( ) async {
130130 let networkExpectation = expectation ( description: " Fetch where Title Match Regex Assets Test " )
131131 self . queryWhere ( . title, operation: . matches( " im " ) ) { ( result: Result < ContentstackResponse < AssetModel > , Error > ) in
132132 switch result {
@@ -137,10 +137,10 @@ class AssetQueryAPITest: XCTestCase {
137137 }
138138 networkExpectation. fulfill ( )
139139 }
140- wait ( for : [ networkExpectation] , timeout: 5 )
140+ await fulfillment ( of : [ networkExpectation] , timeout: 5 )
141141 }
142142
143- func test06Fetch_Asset_fromUID( ) {
143+ func test06Fetch_Asset_fromUID( ) async {
144144 let networkExpectation = expectation ( description: " Fetch Assets from UID Test " )
145145 self . getAsset ( uid: AssetQueryAPITest . kAssetUID) . fetch { ( result: Result < AssetModel , Error > , response: ResponseType ) in
146146 switch result {
@@ -151,10 +151,10 @@ class AssetQueryAPITest: XCTestCase {
151151 }
152152 networkExpectation. fulfill ( )
153153 }
154- wait ( for : [ networkExpectation] , timeout: 5 )
154+ await fulfillment ( of : [ networkExpectation] , timeout: 5 )
155155 }
156156
157- func test07Fetch_AssetQuery_WithDimentsions( ) {
157+ func test07Fetch_AssetQuery_WithDimentsions( ) async {
158158 let networkExpectation = expectation ( description: " Fetch Assets with GLobalFields Test " )
159159 self . getAssetQuery ( )
160160 . include ( params: . dimension)
@@ -169,11 +169,11 @@ class AssetQueryAPITest: XCTestCase {
169169 }
170170 networkExpectation. fulfill ( )
171171 }
172- wait ( for : [ networkExpectation] , timeout: 5 )
172+ await fulfillment ( of : [ networkExpectation] , timeout: 5 )
173173
174174 }
175175
176- func test08Fetch_Asset_WithGlobalFields( ) {
176+ func test08Fetch_Asset_WithGlobalFields( ) async {
177177 let networkExpectation = expectation ( description: " Fetch Assets with GlobalFields Test " )
178178 self . getAsset ( uid: AssetQueryAPITest . kAssetUID)
179179 . includeDimension ( )
@@ -186,10 +186,10 @@ class AssetQueryAPITest: XCTestCase {
186186 }
187187 networkExpectation. fulfill ( )
188188 }
189- wait ( for : [ networkExpectation] , timeout: 5 )
189+ await fulfillment ( of : [ networkExpectation] , timeout: 5 )
190190 }
191191
192- func test09Fetch_AssetQuery_WithCount( ) {
192+ func test09Fetch_AssetQuery_WithCount( ) async {
193193 let networkExpectation = expectation ( description: " Fetch Assets with Count Test " )
194194 self . getAssetQuery ( )
195195 . locale ( " en-us " )
@@ -203,11 +203,11 @@ class AssetQueryAPITest: XCTestCase {
203203 }
204204 networkExpectation. fulfill ( )
205205 }
206- wait ( for : [ networkExpectation] , timeout: 5 )
206+ await fulfillment ( of : [ networkExpectation] , timeout: 5 )
207207
208208 }
209209
210- func test11Fetch_Asset_WithWrongUID_shouldFail( ) {
210+ func test11Fetch_Asset_WithWrongUID_shouldFail( ) async {
211211 let networkExpectation = expectation ( description: " Fetch Assets from wrong UID Test " )
212212 self . getAsset ( uid: " UID " ) . fetch { ( result: Result < AssetModel , Error > , response: ResponseType ) in
213213 switch result {
@@ -221,10 +221,10 @@ class AssetQueryAPITest: XCTestCase {
221221 }
222222 networkExpectation. fulfill ( )
223223 }
224- wait ( for : [ networkExpectation] , timeout: 5 )
224+ await fulfillment ( of : [ networkExpectation] , timeout: 5 )
225225 }
226226
227- func test12Fetch_AssetQuery_WithoutFallback_Result( ) {
227+ func test12Fetch_AssetQuery_WithoutFallback_Result( ) async {
228228 let networkExpectation = expectation ( description: " Fetch Assets without Fallback Test " )
229229 self . getAssetQuery ( ) . locale ( AssetQueryAPITest . locale)
230230 . find { ( result: Result < ContentstackResponse < AssetModel > , Error > , response: ResponseType ) in
@@ -242,10 +242,10 @@ class AssetQueryAPITest: XCTestCase {
242242 }
243243 networkExpectation. fulfill ( )
244244 }
245- wait ( for : [ networkExpectation] , timeout: 5 )
245+ await fulfillment ( of : [ networkExpectation] , timeout: 5 )
246246 }
247247
248- func test13Fetch_AssetQuery_Fallback_Result( ) {
248+ func test13Fetch_AssetQuery_Fallback_Result( ) async {
249249 let networkExpectation = expectation ( description: " Fetch Assets without Fallback Test " )
250250 self . getAssetQuery ( )
251251 . locale ( AssetQueryAPITest . locale)
@@ -275,10 +275,10 @@ class AssetQueryAPITest: XCTestCase {
275275 }
276276 networkExpectation. fulfill ( )
277277 }
278- wait ( for : [ networkExpectation] , timeout: 5 )
278+ await fulfillment ( of : [ networkExpectation] , timeout: 5 )
279279 }
280280
281- func test14Fetch_Asset_UIDWithoutFallback_NoResult( ) {
281+ func test14Fetch_Asset_UIDWithoutFallback_NoResult( ) async {
282282 let networkExpectation = expectation ( description: " Fetch Asset from UID without Fallback Test " )
283283 self . getAsset ( uid: AssetQueryAPITest . kAssetLocaliseUID)
284284 . locale ( " en-gb " )
@@ -294,10 +294,10 @@ class AssetQueryAPITest: XCTestCase {
294294 }
295295 networkExpectation. fulfill ( )
296296 }
297- wait ( for : [ networkExpectation] , timeout: 5 )
297+ await fulfillment ( of : [ networkExpectation] , timeout: 5 )
298298 }
299299
300- func test15Fetch_Asset_UIDWithFallback_NoResult( ) {
300+ func test15Fetch_Asset_UIDWithFallback_NoResult( ) async {
301301 let networkExpectation = expectation ( description: " Fetch Asset from UID without Fallback Test " )
302302 self . getAsset ( uid: AssetQueryAPITest . kAssetLocaliseUID)
303303 . locale ( AssetQueryAPITest . locale)
@@ -315,6 +315,6 @@ class AssetQueryAPITest: XCTestCase {
315315 }
316316 networkExpectation. fulfill ( )
317317 }
318- wait ( for : [ networkExpectation] , timeout: 5 )
318+ await fulfillment ( of : [ networkExpectation] , timeout: 5 )
319319 }
320320}
0 commit comments