diff --git a/Net.Http.WebApi.OData.Tests/Query/SelectExpandQueryOptionTests.cs b/Net.Http.WebApi.OData.Tests/Query/SelectExpandQueryOptionTests.cs index e0f3560..d159201 100644 --- a/Net.Http.WebApi.OData.Tests/Query/SelectExpandQueryOptionTests.cs +++ b/Net.Http.WebApi.OData.Tests/Query/SelectExpandQueryOptionTests.cs @@ -22,7 +22,7 @@ public WhenConstructedWithExpandSingleValue() } [Fact] - public void ThePropertiesShouldContainEachSpecifiedValue() + public void ThePropertiesShouldContainSpecifiedNavigationProperty() { Assert.Equal(1, this.option.Properties.Count); @@ -52,7 +52,7 @@ public WhenConstructedWithExpandStarValue() } [Fact] - public void ThePropertiesShouldContainEachExpandableProperty() + public void ThePropertiesShouldContainAllNavigationProperties() { Assert.Equal(1, this.option.Properties.Count); @@ -82,7 +82,7 @@ public WhenConstructedWithSelectMultipleValues() } [Fact] - public void ThePropertiesShouldContainEachSpecifiedValue() + public void ThePropertiesShouldContainSpecifiedProperties() { Assert.Equal(3, this.option.Properties.Count); @@ -114,7 +114,7 @@ public WhenConstructedWithSelectSingleValue() } [Fact] - public void ThePropertiesShouldContainEachSpecifiedValue() + public void ThePropertiesShouldContainSpecifiedProperty() { Assert.Equal(1, this.option.Properties.Count); @@ -144,9 +144,18 @@ public WhenConstructedWithSelectStarValue() } [Fact] - public void ThePropertiesShouldContainEachProperty() + public void ThePropertiesShouldContainAllProperties() { - Assert.Same(this.option.Properties, this.model.Properties); + Assert.Equal(8, this.option.Properties.Count); + + Assert.Equal("Colour", this.option.Properties[0].Name); + Assert.Equal("Deleted", this.option.Properties[1].Name); + Assert.Equal("Description", this.option.Properties[2].Name); + Assert.Equal("Name", this.option.Properties[3].Name); + Assert.Equal("Price", this.option.Properties[4].Name); + Assert.Equal("ProductId", this.option.Properties[5].Name); + Assert.Equal("Rating", this.option.Properties[6].Name); + Assert.Equal("ReleaseDate", this.option.Properties[7].Name); } [Fact] diff --git a/Net.Http.WebApi.OData/Properties/AssemblyInfo.cs b/Net.Http.WebApi.OData/Properties/AssemblyInfo.cs index 97feaee..2907210 100644 --- a/Net.Http.WebApi.OData/Properties/AssemblyInfo.cs +++ b/Net.Http.WebApi.OData/Properties/AssemblyInfo.cs @@ -47,7 +47,7 @@ // by using the '*' as shown below: [assembly: AssemblyVersion("4.2.0.0")] [assembly: AssemblyFileVersion("4.2.0.0")] -[assembly: AssemblyInformationalVersion("4.2.0.0")] +[assembly: AssemblyInformationalVersion("4.2.1.0")] [assembly: CLSCompliant(true)] [assembly: InternalsVisibleTo("DynamicProxyGenAssembly2, PublicKey=0024000004800000940000000602000000240000525341310004000001000100c547cac37abd99c8db225ef2f6c8a3602f3b3606cc9891605d02baa56104f4cfc0734aa39b93bf7852f7d9266654753cc297e7d2edfe0bac1cdcf9f717241550e0a7b191195b7667bb4f64bcb8e2121380fd1d9d46ad2d92d2d15605093924cceaf74c4861eff62abf69b9291ed0a340e113be11e6a7d3113e92484cf7045cc7")] [assembly: InternalsVisibleTo("Net.Http.WebApi.OData.Tests, PublicKey=002400000480000094000000060200000024000052534131000400000100010099315584ff23b0d08b9120b4ae0da0c7dd9eb581f7b9f92dba164c86a5825dc53d147adf436c0ec9b2584ffdee592b2bb82367f90942dcc020b2ef21169eee345c623446e41dae7ce58e981c8bbcadb7866724028d8a73b321bd65b0536a23715d1b6221be7ef2f6cc37d9b42c0cd892bda118f59453447a39d33d992a23c5ce")] diff --git a/Net.Http.WebApi.OData/Query/SelectExpandQueryOption.cs b/Net.Http.WebApi.OData/Query/SelectExpandQueryOption.cs index b84cb00..2a92ef7 100644 --- a/Net.Http.WebApi.OData/Query/SelectExpandQueryOption.cs +++ b/Net.Http.WebApi.OData/Query/SelectExpandQueryOption.cs @@ -32,7 +32,7 @@ internal SelectExpandQueryOption(string rawValue, EdmComplexType model) { if (rawValue == "$select=*") { - this.Properties = model.Properties; + this.Properties = model.Properties.Where(p => !p.IsNavigable).ToList(); } else if (rawValue == "$expand=*") {