From 1b34b5af23d2a685438125e5378c78160895f1e6 Mon Sep 17 00:00:00 2001 From: Neil Boyd Date: Mon, 16 Oct 2017 15:40:51 +0200 Subject: [PATCH] simplify and fix parent categories --- .../Catalog/SearchTest.cs | 24 +++++++++------- OpenAPI Client/Generated/openapi-4.0.0.cs | 28 ++++++++++--------- 2 files changed, 29 insertions(+), 23 deletions(-) diff --git a/OpenAPI Client Unit Tests/Catalog/SearchTest.cs b/OpenAPI Client Unit Tests/Catalog/SearchTest.cs index 5af8a8c..852c99d 100644 --- a/OpenAPI Client Unit Tests/Catalog/SearchTest.cs +++ b/OpenAPI Client Unit Tests/Catalog/SearchTest.cs @@ -18,15 +18,15 @@ public void TestSearch() searchResultsRequest.IncludeAttributes = true; searchResultsRequest.Offset = 10; searchResultsRequest.Limit = 10; - searchResultsRequest.DataOutputs = new EnumTypes.DataOutputType[] { - EnumTypes.DataOutputType.PRODUCTS, - EnumTypes.DataOutputType.CATEGORIES, - EnumTypes.DataOutputType.REFINEMENTS - }; - searchResultsRequest.Offers = new EnumTypes.OfferType[] { - EnumTypes.OfferType.ALL - }; - + searchResultsRequest.DataOutputs = new EnumTypes.DataOutputType[] { + EnumTypes.DataOutputType.PRODUCTS, + EnumTypes.DataOutputType.CATEGORIES, + EnumTypes.DataOutputType.REFINEMENTS + }; + searchResultsRequest.Offers = new EnumTypes.OfferType[] { + EnumTypes.OfferType.ALL + }; + SearchResults searchResults = client.Search(searchResultsRequest); Assert.IsTrue(searchResults.TotalResultSize > 0); Assert.IsNotNull(searchResults.Categories); @@ -34,7 +34,11 @@ public void TestSearch() Assert.IsNotNull(searchResults.Products); Assert.IsTrue(searchResults.Products.Count > 0); Assert.IsNotNull(searchResults.RefinementGroups); - Assert.IsTrue(searchResults.RefinementGroups.Count > 0); + Assert.IsTrue(searchResults.RefinementGroups.Count > 0); + Assert.IsTrue(searchResults.Products[0].ParentCategoryPaths.Count > 0); + Assert.IsTrue(searchResults.Products[0].ParentCategoryPaths[0].ParentCategories.Count > 0); + Assert.IsFalse(string.IsNullOrEmpty(searchResults.Products[0].ParentCategoryPaths[0].ParentCategories[0].Id)); + Assert.IsFalse(string.IsNullOrEmpty(searchResults.Products[0].ParentCategoryPaths[0].ParentCategories[0].Name)); } } } diff --git a/OpenAPI Client/Generated/openapi-4.0.0.cs b/OpenAPI Client/Generated/openapi-4.0.0.cs index 86ff47f..826ecd2 100644 --- a/OpenAPI Client/Generated/openapi-4.0.0.cs +++ b/OpenAPI Client/Generated/openapi-4.0.0.cs @@ -411,21 +411,23 @@ public List Promotions } } - [System.Xml.Serialization.XmlArrayAttribute(Order = 17)] - [System.Xml.Serialization.XmlArrayItemAttribute("ParentCategories", typeof(ParentCategory), IsNullable = false)] - public List ParentCategoryPaths + public List ParentCategoryPaths { - get - { - return this.parentCategoryPathsField; - } - set - { - this.parentCategoryPathsField = value; - } + get; + set; } } +public partial class ParentCategoryList +{ + public List ParentCategories + { + get; + set; + } + +} + public partial class TrackList { @@ -1223,7 +1225,7 @@ public partial class ParentCategory private string nameField; - public string id + public string Id { get { @@ -1235,7 +1237,7 @@ public string id } } - public string name + public string Name { get {