1616using Contentstack . Management . Core . Tests . Helpers ;
1717using Contentstack . Management . Core . Tests . Model ;
1818using Microsoft . VisualStudio . TestTools . UnitTesting ;
19- using Newtonsoft . Json . Linq ;
19+ using System . Text . Json . Nodes ;
2020
2121namespace Contentstack . Management . Core . Tests . IntegrationTest
2222{
@@ -195,7 +195,7 @@ public void Test009_Should_Get_Taxonomy_Locales()
195195 TestOutputLogger . LogContext ( "TaxonomyUid" , _taxonomyUid ?? "" ) ;
196196 ContentstackResponse response = _stack . Taxonomy ( _taxonomyUid ) . Locales ( ) ;
197197 AssertLogger . IsTrue ( response . IsSuccessStatusCode , $ "Locales failed: { response . OpenResponse ( ) } ", "LocalesSuccess" ) ;
198- var jobj = response . OpenJObjectResponse ( ) ;
198+ var jobj = response . OpenJsonObjectResponse ( ) ;
199199 AssertLogger . IsNotNull ( jobj [ "taxonomies" ] , "Taxonomies in locales response" ) ;
200200 }
201201
@@ -207,7 +207,7 @@ public async Task Test010_Should_Get_Taxonomy_Locales_Async()
207207 TestOutputLogger . LogContext ( "TaxonomyUid" , _taxonomyUid ?? "" ) ;
208208 ContentstackResponse response = await _stack . Taxonomy ( _taxonomyUid ) . LocalesAsync ( ) ;
209209 AssertLogger . IsTrue ( response . IsSuccessStatusCode , $ "LocalesAsync failed: { response . OpenResponse ( ) } ", "LocalesAsyncSuccess" ) ;
210- var jobj = response . OpenJObjectResponse ( ) ;
210+ var jobj = response . OpenJsonObjectResponse ( ) ;
211211 AssertLogger . IsNotNull ( jobj [ "taxonomies" ] , "Taxonomies in locales response" ) ;
212212 }
213213
@@ -219,8 +219,8 @@ public void Test011_Should_Localize_Taxonomy()
219219 _weCreatedTestLocale = false ;
220220 ContentstackResponse localesResponse = _stack . Locale ( ) . Query ( ) . Find ( ) ;
221221 AssertLogger . IsTrue ( localesResponse . IsSuccessStatusCode , $ "Query locales failed: { localesResponse . OpenResponse ( ) } ", "QueryLocalesSuccess" ) ;
222- var jobj = localesResponse . OpenJObjectResponse ( ) ;
223- var localesArray = jobj [ "locales" ] as JArray ?? jobj [ "items" ] as JArray ;
222+ var jobj = localesResponse . OpenJsonObjectResponse ( ) ;
223+ var localesArray = jobj [ "locales" ] as JsonArray ?? jobj [ "items" ] as JsonArray ;
224224 if ( localesArray == null || localesArray . Count == 0 )
225225 {
226226 AssertLogger . Inconclusive ( "Stack has no locales; skipping taxonomy localize tests." ) ;
@@ -537,7 +537,7 @@ public void Test024_Should_Get_Term_Ancestors()
537537 TestOutputLogger . LogContext ( "ChildTermUid" , _childTermUid ?? "" ) ;
538538 ContentstackResponse response = _stack . Taxonomy ( _taxonomyUid ) . Terms ( _childTermUid ) . Ancestors ( ) ;
539539 AssertLogger . IsTrue ( response . IsSuccessStatusCode , $ "Ancestors failed: { response . OpenResponse ( ) } ", "AncestorsSuccess" ) ;
540- var jobj = response . OpenJObjectResponse ( ) ;
540+ var jobj = response . OpenJsonObjectResponse ( ) ;
541541 AssertLogger . IsNotNull ( jobj , "Ancestors response" ) ;
542542 }
543543
@@ -550,7 +550,7 @@ public async Task Test025_Should_Get_Term_Ancestors_Async()
550550 TestOutputLogger . LogContext ( "ChildTermUid" , _childTermUid ?? "" ) ;
551551 ContentstackResponse response = await _stack . Taxonomy ( _taxonomyUid ) . Terms ( _childTermUid ) . AncestorsAsync ( ) ;
552552 AssertLogger . IsTrue ( response . IsSuccessStatusCode , $ "AncestorsAsync failed: { response . OpenResponse ( ) } ", "AncestorsAsyncSuccess" ) ;
553- var jobj = response . OpenJObjectResponse ( ) ;
553+ var jobj = response . OpenJsonObjectResponse ( ) ;
554554 AssertLogger . IsNotNull ( jobj , "Ancestors async response" ) ;
555555 }
556556
@@ -563,7 +563,7 @@ public void Test026_Should_Get_Term_Descendants()
563563 TestOutputLogger . LogContext ( "RootTermUid" , _rootTermUid ?? "" ) ;
564564 ContentstackResponse response = _stack . Taxonomy ( _taxonomyUid ) . Terms ( _rootTermUid ) . Descendants ( ) ;
565565 AssertLogger . IsTrue ( response . IsSuccessStatusCode , $ "Descendants failed: { response . OpenResponse ( ) } ", "DescendantsSuccess" ) ;
566- var jobj = response . OpenJObjectResponse ( ) ;
566+ var jobj = response . OpenJsonObjectResponse ( ) ;
567567 AssertLogger . IsNotNull ( jobj , "Descendants response" ) ;
568568 }
569569
@@ -576,7 +576,7 @@ public async Task Test027_Should_Get_Term_Descendants_Async()
576576 TestOutputLogger . LogContext ( "RootTermUid" , _rootTermUid ?? "" ) ;
577577 ContentstackResponse response = await _stack . Taxonomy ( _taxonomyUid ) . Terms ( _rootTermUid ) . DescendantsAsync ( ) ;
578578 AssertLogger . IsTrue ( response . IsSuccessStatusCode , $ "DescendantsAsync failed: { response . OpenResponse ( ) } ", "DescendantsAsyncSuccess" ) ;
579- var jobj = response . OpenJObjectResponse ( ) ;
579+ var jobj = response . OpenJsonObjectResponse ( ) ;
580580 AssertLogger . IsNotNull ( jobj , "Descendants async response" ) ;
581581 }
582582
@@ -589,7 +589,7 @@ public void Test028_Should_Get_Term_Locales()
589589 TestOutputLogger . LogContext ( "RootTermUid" , _rootTermUid ?? "" ) ;
590590 ContentstackResponse response = _stack . Taxonomy ( _taxonomyUid ) . Terms ( _rootTermUid ) . Locales ( ) ;
591591 AssertLogger . IsTrue ( response . IsSuccessStatusCode , $ "Term Locales failed: { response . OpenResponse ( ) } ", "TermLocalesSuccess" ) ;
592- var jobj = response . OpenJObjectResponse ( ) ;
592+ var jobj = response . OpenJsonObjectResponse ( ) ;
593593 AssertLogger . IsNotNull ( jobj [ "terms" ] , "Terms in locales response" ) ;
594594 }
595595
@@ -602,7 +602,7 @@ public async Task Test029_Should_Get_Term_Locales_Async()
602602 TestOutputLogger . LogContext ( "RootTermUid" , _rootTermUid ?? "" ) ;
603603 ContentstackResponse response = await _stack . Taxonomy ( _taxonomyUid ) . Terms ( _rootTermUid ) . LocalesAsync ( ) ;
604604 AssertLogger . IsTrue ( response . IsSuccessStatusCode , $ "Term LocalesAsync failed: { response . OpenResponse ( ) } ", "TermLocalesAsyncSuccess" ) ;
605- var jobj = response . OpenJObjectResponse ( ) ;
605+ var jobj = response . OpenJsonObjectResponse ( ) ;
606606 AssertLogger . IsNotNull ( jobj [ "terms" ] , "Terms in locales async response" ) ;
607607 }
608608
@@ -710,7 +710,7 @@ public void Test034_Should_Search_Terms()
710710 TestOutputLogger . LogContext ( "TaxonomyUid" , _taxonomyUid ?? "" ) ;
711711 ContentstackResponse response = _stack . Taxonomy ( _taxonomyUid ) . Terms ( ) . Search ( "Root" ) ;
712712 AssertLogger . IsTrue ( response . IsSuccessStatusCode , $ "Search terms failed: { response . OpenResponse ( ) } ", "SearchTermsSuccess" ) ;
713- var jobj = response . OpenJObjectResponse ( ) ;
713+ var jobj = response . OpenJsonObjectResponse ( ) ;
714714 AssertLogger . IsNotNull ( jobj [ "terms" ] ?? jobj [ "items" ] , "Terms or items in search response" ) ;
715715 }
716716
@@ -722,7 +722,7 @@ public async Task Test035_Should_Search_Terms_Async()
722722 TestOutputLogger . LogContext ( "TaxonomyUid" , _taxonomyUid ?? "" ) ;
723723 ContentstackResponse response = await _stack . Taxonomy ( _taxonomyUid ) . Terms ( ) . SearchAsync ( "Root" ) ;
724724 AssertLogger . IsTrue ( response . IsSuccessStatusCode , $ "SearchAsync terms failed: { response . OpenResponse ( ) } ", "SearchAsyncTermsSuccess" ) ;
725- var jobj = response . OpenJObjectResponse ( ) ;
725+ var jobj = response . OpenJsonObjectResponse ( ) ;
726726 AssertLogger . IsNotNull ( jobj [ "terms" ] ?? jobj [ "items" ] , "Terms or items in search async response" ) ;
727727 }
728728
0 commit comments