From 8becfbf895d71a4776115979aea02da2f6295009 Mon Sep 17 00:00:00 2001 From: Sam Xu Date: Wed, 26 Feb 2020 10:15:59 -0800 Subject: [PATCH] Change E2E class Fixture to allow parallel running --- .../PageAttributeEdmTypeConvention.cs | 2 +- .../Extensions/ODataRouteBuilderExtensions.cs | 12 +- .../Aggregation/AggregationTests.cs | 41 +-- .../Aggregation/PagedAggregationTests.cs | 6 +- .../Aggregation/PagedCustomersController.cs | 54 +++- .../AlternateKeys/AlternateKeysTest.cs | 6 +- .../AutoExpand/AutoExpandTests.cs | 12 +- .../DefaultODataBatchHandlerTests.cs | 285 ++++++------------ .../UnbufferedODataBatchHandlerTests.cs | 268 ++++++---------- .../BoundOperation/BoundOperationTest.cs | 6 +- .../Microsoft.Test.E2E.AspNet.OData.csproj | 8 +- .../CustomizeSkipTokenImplementationTest.cs | 6 +- ...Microsoft.Test.E2E.AspNetCore.OData.csproj | 8 +- .../CustomizeSkipTokenImplementationTest.cs | 7 +- ...crosoft.Test.E2E.AspNetCore3x.OData.csproj | 11 +- .../Cast/CastTest.cs | 6 +- ...bHostTestBase.cs => WebHostTestBaseOfT.cs} | 17 +- ...estFixture.cs => WebHostTestFixtureOfT.cs} | 163 +++++----- .../Common/ODataTestExtension.cs | 2 +- .../ComplexTypeInheritanceSerializeTest.cs | 6 +- .../ComplexTypeInheritanceTests.cs | 7 +- .../Containment/ContainmentTests.cs | 6 +- .../DateAndTimeOfDay/DateAndTimeOfDayTest.cs | 6 +- .../DateAndTimeOfDayWithEfTest.cs | 6 +- .../DateAndTimeOfDay/DateWithEfTest.cs | 6 +- .../DateTimeSupport/DateTimeTest.cs | 6 +- .../DeltaQueryTests/DeltaQueryTests.cs | 6 +- .../CustomizeCountQueryValidatorTest.cs | 6 +- .../CustomizeSerializerTest.cs | 6 +- ...ollarFormatOverrideAcceptMediaTypeTests.cs | 6 +- ...DollarFormatWithoutAcceptMediaTypeTests.cs | 6 +- .../DollarId/DollarIdClientTest.cs | 9 +- .../DollarId/DollarIdControllers.cs | 1 + .../DollarId/DollarIdTest.cs | 10 +- .../DollarLevels/DollarLevelsTest.cs | 6 +- .../DeleteUpdatedEntryWithIfMatchETagsTest.cs | 6 +- .../ETags/DerivedETagTests.cs | 6 +- .../ETags/ETagCurrencyTokenEfContextTest.cs | 6 +- .../ETags/ETagsController.cs | 2 + .../ETags/ETagsOtherTypesTest.cs | 6 +- .../ETags/ETagsUntypedTests.cs | 6 +- .../ETags/GetEntryWithIfNoneMatchETagsTest.cs | 6 +- .../ETags/JsonETagsTests.cs | 8 +- .../PatchUpdatedEntryWithIfMatchETagsTest.cs | 6 +- .../PutUpdatedEntryWithIfMatchETagsTest.cs | 6 +- .../EntitySetAggregationTests.cs | 6 +- .../Enums/EnumsTest.cs | 6 +- .../ForeignKey/ForeignKeyTest.cs | 6 +- .../Formatter/BaseAddressFactoryTest.cs | 6 +- .../Formatter/CollectionPropertyTests.cs | 4 +- .../Formatter/ComplexTypeTests.cs | 4 +- .../Formatter/DeltaTests.cs | 16 +- .../Formatter/ErrorMessagesTests.cs | 6 +- .../SerializeEntityReferenceLinks.cs | 6 +- .../Extensibility/SupportDollarValue.cs | 6 +- .../Formatter/HttpAndODataErrorTests.cs | 12 +- .../Formatter/InheritanceTests.cs | 4 +- .../JsonLightCollectionPropertyTests.cs | 6 +- .../JsonLight/JsonLightComplexTypeTests.cs | 6 +- .../JsonLight/JsonLightDeltaTests.cs | 6 +- ...ghtDeserializationAndSerializationTests.cs | 6 +- .../JsonLight/JsonLightInheritanceTests.cs | 6 +- .../JsonLight/JsonLightMixScenarioTests.cs | 6 +- .../JsonLight/JsonLightRandomModelTests.cs | 6 +- .../JsonLight/Metadata/ActionMetadataTests.cs | 6 +- .../JsonLight/Metadata/ComplexTypeTests.cs | 6 +- .../CustomConventionActionMetadataTests.cs | 6 +- .../JsonLight/Metadata/EntryMetadataTests.cs | 6 +- .../JsonLight/Metadata/FeedMetadataTests.cs | 6 +- .../Metadata/MinimalMetadataSpecificTests.cs | 6 +- .../Metadata/PrimitiveTypesMetadataTests.cs | 6 +- .../Formatter/MixScenarioTests.cs | 10 +- ...edSerializeWithoutNavigationSourceTests.cs | 6 +- .../Formatter/ODataFormatterTestBase.cs | 4 +- .../Formatter/ODataResultTests.cs | 15 +- .../Formatter/RandomModelTests.cs | 4 +- .../Formatter/SecurityTests.cs | 6 +- .../Formatter/ServerDrivenPagingTests.cs | 6 +- .../Formatter/SupportMediaTypesTests.cs | 6 +- .../Untyped/UntypedDeltaSerializationTests.cs | 6 +- .../Untyped/UntypedSerializationTests.cs | 6 +- .../LowerCamelCase/LowerCamelCaseTest.cs | 6 +- .../ModelAliasing/FormattersTests.cs | 6 +- .../ModelAliasing/MetadataTests.cs | 6 +- .../ModelAliasing/QueryTests.cs | 6 +- .../CombinedTest/CombinedTest.cs | 14 +- .../CountAttributeTest/CountAttributeTest.cs | 6 +- .../ExpandAttributeTest.cs | 6 +- .../FilterAttributeTest.cs | 6 +- .../OrderByAttributeTest.cs | 6 +- .../PageAttributeTest/PageAttributeTest.cs | 6 +- .../PageAttributeTest/SkipTokenTest.cs | 7 +- .../SelectAttributeTest.cs | 6 +- .../ModelBuilder/ActionMetadataTests.cs | 6 +- .../AttributeConventionModelBuilderTests.cs | 21 +- .../ConditionalLinkGenerationTests.cs | 8 +- .../ModelBuilder/ExplicitModelBuilderTests.cs | 6 +- .../ModelBuilder/ImplicitModelBuilderTests.cs | 20 +- .../ModelBuilder/InheritanceTests.cs | 20 +- .../MultipleEntitySetOnSameClrTypeTests.cs | 6 +- .../ModelBuilder/ODataActionTests.cs | 6 +- .../ModelBuilder/PropertyTests.cs | 12 +- .../RecursiveComplexTypesE2ETests.cs | 6 +- .../SpecialCharactersLinkGenerationTests.cs | 28 +- ...ialPrimaryKeyTypesInLinkGenerationTests.cs | 6 +- .../UnicodeLinkGenerationTests.cs | 6 +- .../NavigationPropertyOnComplexTypeTests.cs | 6 +- .../SelectImprovementOnComplexTypeTests.cs | 6 +- .../ODataCountTest/CountTest.cs | 6 +- .../ODataOrderByTest/OrderByTest.cs | 6 +- .../ODataPathHandler/LinkGenerationTests.cs | 6 +- .../ODataPathHandler/UnicodeRouteTests.cs | 14 +- .../OpenType/TypedTest.cs | 15 +- .../ParameterAlias/ParameterAliasTest.cs | 6 +- .../QueryComposition/AnonymousTypeTests.cs | 6 +- .../ComplextTypeCollectionTests.cs | 6 +- .../QueryComposition/FilterTests.cs | 6 +- .../GlobalQueryableFilterTests.cs | 27 +- .../InheritanceQueryableTests.cs | 26 +- .../QueryComposition/InvalidQueryTests.cs | 6 +- .../IsOf/IsofFunctionTests.cs | 6 +- .../QueryComposition/JsonSelectExpandTests.cs | 6 +- .../JsonSingleResultSelectExpandTests.cs | 6 +- .../QueryComposition/JsonpQueryableTests.cs | 6 +- .../QueryComposition/NestedClassTests.cs | 6 +- .../ODataQueryOptionsTests.cs | 6 +- .../QueryComposition/OrderByTests.cs | 6 +- .../QueryComposition/PrimitiveTypesTests.cs | 6 +- .../QueryComposition/QueryFuzzingTests.cs | 6 +- .../QueryComposition/SecurityTests.cs | 6 +- .../QueryComposition/SelectExpandEFTests.cs | 6 +- .../QueryComposition/SelectExpandTests.cs | 6 +- .../SelectTypeExplosionTests.cs | 6 +- .../SingleResultSelectExpandTests.cs | 6 +- .../QueryComposition/StableOrderTests.cs | 6 +- .../QueryComposition/TopSkipOrderByTests.cs | 6 +- .../QueryComposition/UriParserTests.cs | 6 +- .../QueryComposition/ValidatorTests.cs | 6 +- .../Routing/ActionRoutingConventionTests.cs | 6 +- .../Routing/AddRelatedObjectTests.cs | 6 +- .../Routing/AttributeRoutingTests.cs | 6 +- .../DynamicPropertiesTest.cs | 6 +- .../Routing/ODataRouteTests.cs | 6 +- .../Routing/ODataValueProviderTests.cs | 6 +- .../Routing/RefRoutingConventionTests.cs | 6 +- .../UnqualifiedNameCallRoutingTests.cs | 6 +- .../SingleResult/SingleResultTests.cs | 6 +- .../Singleton/PartnersController.cs | 2 +- .../Singleton/SingletonClientTest.cs | 7 +- .../Singleton/SingletonTest.cs | 7 +- .../Spatial/SpatialTests.cs | 6 +- .../Swagger/SwaggerMetadataTest.cs | 6 +- .../SxS/SxSODataV3AndV4Test.cs | 6 +- .../SxS2/SxSODataV3AndV4Test.cs | 10 +- .../UnboundOperation/UnboundOperationTest.cs | 7 +- .../UriParserExtension/CaseInsensitiveTest.cs | 6 +- .../UriParserExtension/EnumPrefixFreeTest.cs | 6 +- .../UriParserExtension/UnqualifiedCallTest.cs | 6 +- ...olverDependencyTestWithOldDefaultConfig.cs | 6 +- .../Validation/DeltaOfTValidationTests.cs | 6 +- 160 files changed, 874 insertions(+), 1055 deletions(-) rename test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Execution/{WebHostTestBase.cs => WebHostTestBaseOfT.cs} (64%) rename test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Execution/{WebHostTestFixture.cs => WebHostTestFixtureOfT.cs} (79%) diff --git a/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/PageAttributeEdmTypeConvention.cs b/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/PageAttributeEdmTypeConvention.cs index d6e7523aa8..26d77a3c6d 100644 --- a/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/PageAttributeEdmTypeConvention.cs +++ b/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/PageAttributeEdmTypeConvention.cs @@ -45,7 +45,7 @@ public override void Apply(StructuralTypeConfiguration edmTypeConfiguration, ODa } else { - querySettings.MaxTop = pageAttribute.MaxTop; + querySettings.MaxTop = pageAttribute.MaxTop; } if (pageAttribute.PageSize > 0) diff --git a/src/Microsoft.AspNetCore.OData/Extensions/ODataRouteBuilderExtensions.cs b/src/Microsoft.AspNetCore.OData/Extensions/ODataRouteBuilderExtensions.cs index 84f0c8588d..e28051fbc0 100644 --- a/src/Microsoft.AspNetCore.OData/Extensions/ODataRouteBuilderExtensions.cs +++ b/src/Microsoft.AspNetCore.OData/Extensions/ODataRouteBuilderExtensions.cs @@ -44,10 +44,10 @@ public static IRouteBuilder SetDefaultQuerySettings(this IRouteBuilder builder, throw Error.ArgumentNull("defaultQuerySettings"); } - if (!defaultQuerySettings.MaxTop.HasValue || defaultQuerySettings.MaxTop > 0) - { - ModelBoundQuerySettings.DefaultModelBoundQuerySettings.MaxTop = defaultQuerySettings.MaxTop; - } + //if (!defaultQuerySettings.MaxTop.HasValue || defaultQuerySettings.MaxTop > 0) + //{ + // ModelBoundQuerySettings.DefaultModelBoundQuerySettings.MaxTop = defaultQuerySettings.MaxTop; + //} DefaultQuerySettings querySettings = builder.ServiceProvider.GetRequiredService(); if (querySettings == null) @@ -91,10 +91,6 @@ public static IRouteBuilder MaxTop(this IRouteBuilder builder, int? maxTopValue) DefaultQuerySettings defaultQuerySettings = builder.GetDefaultQuerySettings(); defaultQuerySettings.MaxTop = maxTopValue; - if (!maxTopValue.HasValue || maxTopValue > 0) - { - ModelBoundQuerySettings.DefaultModelBoundQuerySettings.MaxTop = maxTopValue; - } return builder; } diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Aggregation/AggregationTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Aggregation/AggregationTests.cs index c7040e247a..19a76259fc 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Aggregation/AggregationTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Aggregation/AggregationTests.cs @@ -17,17 +17,18 @@ namespace Microsoft.Test.E2E.AspNet.OData.Aggregation { - public class AggregationTestsEFClassic: AggregationTests + public class AggregationTestsEFClassic: AggregationTests { - public AggregationTestsEFClassic(WebHostTestFixture fixture) + public AggregationTestsEFClassic(WebHostTestFixture fixture) : base(fixture) { } - protected override void UpdateConfiguration(WebRouteConfiguration configuration) + protected static void UpdateConfigure(WebRouteConfiguration configuration) { configuration.AddControllers(typeof(CustomersController)); - base.UpdateConfiguration(configuration); + + UpdateConfigureOnBase(configuration); } [Theory] @@ -54,50 +55,50 @@ public async Task CustomAggregateStdDevWorks(string query) } #if NETCORE - public class AggregationTestsEFCoreInMemory : AggregationTests + public class AggregationTestsEFCoreInMemory : AggregationTests { - public AggregationTestsEFCoreInMemory(WebHostTestFixture fixture) + public AggregationTestsEFCoreInMemory(WebHostTestFixture fixture) : base(fixture) { } - protected override void UpdateConfiguration(WebRouteConfiguration configuration) + protected static void UpdateConfigure(WebRouteConfiguration configuration) { configuration.AddControllers(typeof(CoreCustomersController)); - base.UpdateConfiguration(configuration); + + UpdateConfigureOnBase(configuration); } } - public class AggregationTestsEFCoreSql : AggregationTests + public class AggregationTestsEFCoreSql : AggregationTests { - public AggregationTestsEFCoreSql(WebHostTestFixture fixture) + public AggregationTestsEFCoreSql(WebHostTestFixture fixture) : base(fixture) { } - protected override void UpdateConfiguration(WebRouteConfiguration configuration) + protected static void UpdateConfigure(WebRouteConfiguration configuration) { configuration.AddControllers(typeof(CoreCustomersController)); - base.UpdateConfiguration(configuration); + + UpdateConfigureOnBase(configuration); } } #endif #if !NETCORE - public class LinqToSqlAggregationTests : WebHostTestBase + public class LinqToSqlAggregationTests : WebHostTestBase { protected string AggregationTestBaseUrl => "{0}/aggregation/Customers"; - public LinqToSqlAggregationTests(WebHostTestFixture fixture) + public LinqToSqlAggregationTests(WebHostTestFixture fixture) : base(fixture) { } - - protected override void UpdateConfiguration(WebRouteConfiguration configuration) + protected static void UpdateConfigure(WebRouteConfiguration configuration) { - configuration.AddControllers(typeof(LinqToSqlCustomersController)); configuration.JsonReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Ignore; configuration.Count().Filter().OrderBy().Expand().MaxTop(null); @@ -128,16 +129,16 @@ public async Task ApplyThrows() } #endif - public abstract class AggregationTests : WebHostTestBase + public abstract class AggregationTests : WebHostTestBase { protected string AggregationTestBaseUrl => "{0}/aggregation/Customers"; - public AggregationTests(WebHostTestFixture fixture) + public AggregationTests(WebHostTestFixture fixture) :base(fixture) { } - protected override void UpdateConfiguration(WebRouteConfiguration configuration) + protected static void UpdateConfigureOnBase(WebRouteConfiguration configuration) { configuration.JsonReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Ignore; configuration.Count().Filter().OrderBy().Expand().MaxTop(null); diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Aggregation/PagedAggregationTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Aggregation/PagedAggregationTests.cs index f7e85f9922..42368b7753 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Aggregation/PagedAggregationTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Aggregation/PagedAggregationTests.cs @@ -13,16 +13,16 @@ namespace Microsoft.Test.E2E.AspNet.OData.Aggregation { - public class PagedAggregationTests : WebHostTestBase + public class PagedAggregationTests : WebHostTestBase { private const string AggregationTestBaseUrl = "{0}/pagedaggregation/Customers"; - public PagedAggregationTests(WebHostTestFixture fixture) + public PagedAggregationTests(WebHostTestFixture fixture) :base(fixture) { } - protected override void UpdateConfiguration(WebRouteConfiguration configuration) + protected static void UpdateConfigure(WebRouteConfiguration configuration) { configuration.AddControllers(typeof (Paged.CustomersController)); configuration.JsonReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Ignore; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Aggregation/PagedCustomersController.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Aggregation/PagedCustomersController.cs index b1f7089c5c..1540efd756 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Aggregation/PagedCustomersController.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Aggregation/PagedCustomersController.cs @@ -1,19 +1,65 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. +using System.Collections.Generic; using System.Linq; using Microsoft.AspNet.OData; namespace Microsoft.Test.E2E.AspNet.OData.Aggregation.Paged { - public class CustomersController : BaseCustomersController + public class CustomersController { [EnableQuery(PageSize = 5)] public IQueryable Get() { - ResetDataSource(); - var db = new AggregationContext(); - return db.Customers; + return Generate().AsQueryable(); + } + + public IList Generate() + { + IList customers = new List(); + for (int i = 1; i < 10; i++) + { + var customer = new Customer + { + Id = i, + Name = "Customer" + i % 2, + Bucket = i % 2 == 0 ? (CustomerBucket?)CustomerBucket.Small : null, + Order = new Order + { + Id = i, + Name = "Order" + i % 2, + Price = i * 100 + }, + Address = new Address + { + Name = "City" + i % 2, + Street = "Street" + i % 2, + } + }; + + customers.Add(customer); + } + + customers.Add(new Customer() + { + Id = 10, + Name = null, + Bucket = CustomerBucket.Big, + Address = new Address + { + Name = "City1", + Street = "Street", + }, + Order = new Order + { + Id = 10, + Name = "Order" + 10 % 2, + Price = 0 + }, + }); + + return customers; } } } diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/AlternateKeys/AlternateKeysTest.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/AlternateKeys/AlternateKeysTest.cs index a19697b036..30432fa908 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/AlternateKeys/AlternateKeysTest.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/AlternateKeys/AlternateKeysTest.cs @@ -19,14 +19,14 @@ namespace Microsoft.Test.E2E.AspNet.OData.AlternateKeys { - public class AlternateKeysTest : WebHostTestBase + public class AlternateKeysTest : WebHostTestBase { - public AlternateKeysTest(WebHostTestFixture fixture) + public AlternateKeysTest(WebHostTestFixture fixture) :base(fixture) { } - protected override void UpdateConfiguration(WebRouteConfiguration configuration) + protected static void UpdateConfigure(WebRouteConfiguration configuration) { var controllers = new[] { diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/AutoExpand/AutoExpandTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/AutoExpand/AutoExpandTests.cs index 4e26a2b1d3..251812048b 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/AutoExpand/AutoExpandTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/AutoExpand/AutoExpandTests.cs @@ -15,11 +15,11 @@ namespace Microsoft.Test.E2E.AspNet.OData.AutoExpand { - public class AutoExpandTests : WebHostTestBase + public class AutoExpandTests : WebHostTestBase { private const string AutoExpandTestBaseUrl = "{0}/autoexpand/Customers(5)"; - public AutoExpandTests(WebHostTestFixture fixture) + public AutoExpandTests(WebHostTestFixture fixture) :base(fixture) { } @@ -39,18 +39,18 @@ public static TheoryDataSet AutoExpandTestData } } - protected override void UpdateConfiguration(WebRouteConfiguration configuration) + protected static void UpdateConfigure(WebRouteConfiguration configuration) { configuration.AddControllers( - typeof (CustomersController), + typeof (CustomersController), typeof (PeopleController), typeof (NormalOrdersController)); configuration.JsonReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Ignore; configuration.Count().Filter().OrderBy().Expand().MaxTop(null).Select(); configuration.MapODataServiceRoute( - "autoexpand", - "autoexpand", + "autoexpand", + "autoexpand", AutoExpandEdmModel.GetEdmModel(configuration)); } diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Batch/Tests/DataServicesClient/DefaultODataBatchHandlerTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Batch/Tests/DataServicesClient/DefaultODataBatchHandlerTests.cs index 9572ce955c..42a1b6f989 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Batch/Tests/DataServicesClient/DefaultODataBatchHandlerTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Batch/Tests/DataServicesClient/DefaultODataBatchHandlerTests.cs @@ -88,14 +88,14 @@ public DefaultBatchOrderController() } } - public class DefaultBatchHandlerCUDBatchTests : WebHostTestBase + public class DefaultBatchHandlerCUDBatchTests : WebHostTestBase { - public DefaultBatchHandlerCUDBatchTests(WebHostTestFixture fixture) + public DefaultBatchHandlerCUDBatchTests(WebHostTestFixture fixture) :base(fixture) { } - protected override void UpdateConfiguration(WebRouteConfiguration configuration) + protected static void UpdateConfigure(WebRouteConfiguration configuration) { ODataModelBuilder builder = configuration.CreateConventionModelBuilder(); configuration.Count().Filter().OrderBy().Expand().MaxTop(null); @@ -150,6 +150,90 @@ public async Task CanPerformCudOperationsOnABatch() Assert.Single(changedCustomersList, x => x.Id == 10); } + [Fact] + public async Task CanBatchQueriesWithDataServicesClient() + { + Uri serviceUrl = new Uri(BaseAddress + "/DefaultBatch"); + DefaultBatchProxy.Container client = new DefaultBatchProxy.Container(serviceUrl); + client.Format.UseJson(); + Uri customersRequestUri = new Uri(BaseAddress + "/DefaultBatch/DefaultBatchCustomer"); + DataServiceRequest customersRequest = new DataServiceRequest(customersRequestUri); + Uri singleCustomerRequestUri = new Uri(BaseAddress + "/DefaultBatch/DefaultBatchCustomer(0)"); + DataServiceRequest singleCustomerRequest = new DataServiceRequest(singleCustomerRequestUri); + + DataServiceResponse batchResponse = await client.ExecuteBatchAsync(customersRequest, singleCustomerRequest); + + if (batchResponse.IsBatchResponse) + { + Assert.Equal(200, batchResponse.BatchStatusCode); + } + + foreach (QueryOperationResponse response in batchResponse) + { + Assert.Equal(200, response.StatusCode); + if (response.Query.RequestUri == customersRequestUri) + { + // Previous test could modify the total count to be anywhere from, 10 to 14. + Assert.InRange(response.Cast().Count(), 10, 14); + continue; + } + if (response.Query.RequestUri == singleCustomerRequestUri) + { + Assert.Single(response.Cast()); + continue; + } + } + } + + [Fact] + public async Task SendsIndividualErrorWhenOneOfTheRequestsFails() + { + Uri serviceUrl = new Uri(BaseAddress + "/DefaultBatch"); + DefaultBatchProxy.Container client = new DefaultBatchProxy.Container(serviceUrl); + client.Format.UseJson(); + + DefaultBatchProxy.DefaultBatchCustomer validCustomer = new DefaultBatchProxy.DefaultBatchCustomer() + { + Id = 10, + Name = "Customer 10" + }; + + DefaultBatchProxy.DefaultBatchCustomer invalidCustomer = new DefaultBatchProxy.DefaultBatchCustomer() + { + Id = -1, + Name = "Customer -1" + }; + + client.AddToDefaultBatchCustomer(validCustomer); + client.AddToDefaultBatchCustomer(invalidCustomer); + var exception = await Assert.ThrowsAsync(async () => + { + DataServiceResponse response = await client.SaveChangesAsync(SaveChangesOptions.BatchWithSingleChangeset); + }); + + Assert.NotNull(exception); + Assert.Equal(200, exception.Response.BatchStatusCode); + Assert.Single(exception.Response); + } + + [Fact] + public async Task CanSetLinksInABatchWithDataServicesClient() + { + Uri serviceUrl = new Uri(BaseAddress + "/DefaultBatch"); + DefaultBatchProxy.Container client = new DefaultBatchProxy.Container(serviceUrl); + client.Format.UseJson(); + + DefaultBatchProxy.DefaultBatchCustomer customer = (await client.DefaultBatchCustomer.ExecuteAsync()).First(); + DefaultBatchProxy.DefaultBatchOrder order = new DefaultBatchProxy.DefaultBatchOrder() { Id = 0, PurchaseDate = DateTime.Now }; + + client.AddToDefaultBatchOrder(order); + + client.AddLink(customer, "Orders", order); + + var response = await client.SaveChangesAsync(SaveChangesOptions.BatchWithSingleChangeset); + Assert.Equal(200, response.BatchStatusCode); + } + [Fact] public async Task CanHandleAbsoluteAndRelativeUrls() { @@ -549,203 +633,14 @@ public async Task CanHandleSingleDeleteInBatch() } } - public class DefaultBatchHandlerQueryBatchTests : WebHostTestBase - { - public DefaultBatchHandlerQueryBatchTests(WebHostTestFixture fixture) - :base(fixture) - { - } - - protected override void UpdateConfiguration(WebRouteConfiguration configuration) - { - configuration.MapODataServiceRoute( - "batch", - "DefaultBatch", - GetEdmModel(configuration), - new DefaultODataPathHandler(), - ODataRoutingConventions.CreateDefault(), - configuration.CreateDefaultODataBatchHandler()); - } - - protected static IEdmModel GetEdmModel(WebRouteConfiguration configuration) - { - var builder = configuration.CreateConventionModelBuilder(); - builder.EntitySet("DefaultBatchCustomer") - .EntityType - .Collection - .Action("OddCustomers") - .ReturnsCollectionFromEntitySet("DefaultBatchCustomer"); - - builder.EntitySet("DefaultBatchOrder"); - builder.MaxDataServiceVersion = builder.DataServiceVersion; - return builder.GetEdmModel(); - } - - [Fact] - public async Task CanBatchQueriesWithDataServicesClient() - { - Uri serviceUrl = new Uri(BaseAddress + "/DefaultBatch"); - DefaultBatchProxy.Container client = new DefaultBatchProxy.Container(serviceUrl); - client.Format.UseJson(); - Uri customersRequestUri = new Uri(BaseAddress + "/DefaultBatch/DefaultBatchCustomer"); - DataServiceRequest customersRequest = new DataServiceRequest(customersRequestUri); - Uri singleCustomerRequestUri = new Uri(BaseAddress + "/DefaultBatch/DefaultBatchCustomer(0)"); - DataServiceRequest singleCustomerRequest = new DataServiceRequest(singleCustomerRequestUri); - - DataServiceResponse batchResponse = await client.ExecuteBatchAsync(customersRequest, singleCustomerRequest); - - if (batchResponse.IsBatchResponse) - { - Assert.Equal(200, batchResponse.BatchStatusCode); - } - - foreach (QueryOperationResponse response in batchResponse) - { - Assert.Equal(200, response.StatusCode); - if (response.Query.RequestUri == customersRequestUri) - { - // Previous test could modify the total count to be anywhere from, 10 to 14. - Assert.InRange(response.Cast().Count(), 10, 14); - continue; - } - if (response.Query.RequestUri == singleCustomerRequestUri) - { - Assert.Single(response.Cast()); - continue; - } - } - } - } - - - public class DefaultBatchHandlerErrorsBatchTests : WebHostTestBase - { - public DefaultBatchHandlerErrorsBatchTests(WebHostTestFixture fixture) - :base(fixture) - { - } - - protected override void UpdateConfiguration(WebRouteConfiguration configuration) - { - configuration.MapODataServiceRoute( - "batch", - "DefaultBatch", - GetEdmModel(configuration), - new DefaultODataPathHandler(), - ODataRoutingConventions.CreateDefault(), - configuration.CreateDefaultODataBatchHandler()); - } - - protected static IEdmModel GetEdmModel(WebRouteConfiguration configuration) - { - var builder = configuration.CreateConventionModelBuilder(); - - builder.EntitySet("DefaultBatchCustomer") - .EntityType - .Collection - .Action("OddCustomers") - .ReturnsCollectionFromEntitySet("DefaultBatchCustomer"); - - builder.EntitySet("DefaultBatchOrder"); - - builder.MaxDataServiceVersion = builder.DataServiceVersion; - return builder.GetEdmModel(); - } - - [Fact] - public async Task SendsIndividualErrorWhenOneOfTheRequestsFails() - { - Uri serviceUrl = new Uri(BaseAddress + "/DefaultBatch"); - DefaultBatchProxy.Container client = new DefaultBatchProxy.Container(serviceUrl); - client.Format.UseJson(); - - DefaultBatchProxy.DefaultBatchCustomer validCustomer = new DefaultBatchProxy.DefaultBatchCustomer() - { - Id = 10, - Name = "Customer 10" - }; - - DefaultBatchProxy.DefaultBatchCustomer invalidCustomer = new DefaultBatchProxy.DefaultBatchCustomer() - { - Id = -1, - Name = "Customer -1" - }; - - client.AddToDefaultBatchCustomer(validCustomer); - client.AddToDefaultBatchCustomer(invalidCustomer); - var exception = await Assert.ThrowsAsync(async () => - { - DataServiceResponse response = await client.SaveChangesAsync(SaveChangesOptions.BatchWithSingleChangeset); - }); - - Assert.NotNull(exception); - Assert.Equal(200, exception.Response.BatchStatusCode); - Assert.Single(exception.Response); - } - } - - - public class DefaultBatchHandlerLinksBatchTests : WebHostTestBase - { - public DefaultBatchHandlerLinksBatchTests(WebHostTestFixture fixture) - :base(fixture) - { - } - - protected override void UpdateConfiguration(WebRouteConfiguration configuration) - { - configuration.MapODataServiceRoute( - "batch", - "DefaultBatch", - GetEdmModel(configuration), - new DefaultODataPathHandler(), - ODataRoutingConventions.CreateDefault(), - configuration.CreateDefaultODataBatchHandler()); - } - - protected static IEdmModel GetEdmModel(WebRouteConfiguration configuration) - { - var builder = configuration.CreateConventionModelBuilder(); - - builder.EntitySet("DefaultBatchCustomer") - .EntityType - .Collection.Action("OddCustomers") - .ReturnsCollectionFromEntitySet("DefaultBatchCustomer"); - - builder.EntitySet("DefaultBatchOrder"); - - builder.MaxDataServiceVersion = builder.DataServiceVersion; - - return builder.GetEdmModel(); - } - - [Fact] - public async Task CanSetLinksInABatchWithDataServicesClient() - { - Uri serviceUrl = new Uri(BaseAddress + "/DefaultBatch"); - DefaultBatchProxy.Container client = new DefaultBatchProxy.Container(serviceUrl); - client.Format.UseJson(); - - DefaultBatchProxy.DefaultBatchCustomer customer = (await client.DefaultBatchCustomer.ExecuteAsync()).First(); - DefaultBatchProxy.DefaultBatchOrder order = new DefaultBatchProxy.DefaultBatchOrder() { Id = 0, PurchaseDate = DateTime.Now }; - - client.AddToDefaultBatchOrder(order); - - client.AddLink(customer, "Orders", order); - - var response = await client.SaveChangesAsync(SaveChangesOptions.BatchWithSingleChangeset); - Assert.Equal(200, response.BatchStatusCode); - } - } - - public class DefaultBatchHandlerContinueOnErrorBatchTests : WebHostTestBase + public class DefaultBatchHandlerContinueOnErrorBatchTests : WebHostTestBase { - public DefaultBatchHandlerContinueOnErrorBatchTests(WebHostTestFixture fixture) + public DefaultBatchHandlerContinueOnErrorBatchTests(WebHostTestFixture fixture) :base(fixture) { } - protected override void UpdateConfiguration(WebRouteConfiguration configuration) + protected static void UpdateConfigure(WebRouteConfiguration configuration) { ODataModelBuilder builder = configuration.CreateConventionModelBuilder(); configuration.MapODataServiceRoute( diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Batch/Tests/DataServicesClient/UnbufferedODataBatchHandlerTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Batch/Tests/DataServicesClient/UnbufferedODataBatchHandlerTests.cs index be868b0c0b..3f42990342 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Batch/Tests/DataServicesClient/UnbufferedODataBatchHandlerTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Batch/Tests/DataServicesClient/UnbufferedODataBatchHandlerTests.cs @@ -88,14 +88,14 @@ public UnbufferedBatchOrderController() } } - public class CUDBatchTests : WebHostTestBase + public class CUDBatchTests : WebHostTestBase { - public CUDBatchTests(WebHostTestFixture fixture) - : base(fixture) + public CUDBatchTests(WebHostTestFixture fixture) + :base(fixture) { } - protected override void UpdateConfiguration(WebRouteConfiguration configuration) + protected static void UpdateConfigure(WebRouteConfiguration configuration) { ODataModelBuilder builder = configuration.CreateConventionModelBuilder(); configuration.Count().Filter().OrderBy().Expand().MaxTop(null); @@ -152,6 +152,89 @@ public async Task CanPerformCudOperationsOnABatch() Assert.Single(changedCustomerList, x => x.Id == 10); } + [Fact] + public async Task CanBatchQueriesWithDataServicesClient() + { + Uri serviceUrl = new Uri(BaseAddress + "/UnbufferedBatch"); + UnbufferedBatchProxy.Container client = new UnbufferedBatchProxy.Container(serviceUrl); + client.Format.UseJson(); + Uri customersRequestUri = new Uri(BaseAddress + "/UnbufferedBatch/UnbufferedBatchCustomer"); + DataServiceRequest customersRequest = new DataServiceRequest(customersRequestUri); + Uri singleCustomerRequestUri = new Uri(BaseAddress + "/UnbufferedBatch/UnbufferedBatchCustomer(0)"); + DataServiceRequest singleCustomerRequest = new DataServiceRequest(singleCustomerRequestUri); + + DataServiceResponse batchResponse = await client.ExecuteBatchAsync(customersRequest, singleCustomerRequest); + + if (batchResponse.IsBatchResponse) + { + Assert.Equal(200, batchResponse.BatchStatusCode); + } + + foreach (QueryOperationResponse response in batchResponse) + { + Assert.Equal(200, response.StatusCode); + if (response.Query.RequestUri == customersRequestUri) + { + // Previous test could modify the total count to be anywhere from, 10 to 14. + Assert.InRange(response.Cast().Count(), 10, 14); + continue; + } + if (response.Query.RequestUri == singleCustomerRequestUri) + { + Assert.Single(response.Cast()); + continue; + } + } + } + + [Fact] + public async Task SendsIndividualErrorWhenOneOfTheRequestsFails() + { + Uri serviceUrl = new Uri(BaseAddress + "/UnbufferedBatch"); + UnbufferedBatchProxy.Container client = new UnbufferedBatchProxy.Container(serviceUrl); + client.Format.UseJson(); + + UnbufferedBatchProxy.UnbufferedBatchCustomer validCustomer = new UnbufferedBatchProxy.UnbufferedBatchCustomer() + { + Id = 10, + Name = "Customer 10" + }; + + UnbufferedBatchProxy.UnbufferedBatchCustomer invalidCustomer = new UnbufferedBatchProxy.UnbufferedBatchCustomer() + { + Id = -1, + Name = "Customer -1" + }; + + client.AddToUnbufferedBatchCustomer(validCustomer); + client.AddToUnbufferedBatchCustomer(invalidCustomer); + var exception = await Assert.ThrowsAsync(async () => + { + DataServiceResponse response = await client.SaveChangesAsync(SaveChangesOptions.BatchWithSingleChangeset); + }); + + Assert.NotNull(exception); + Assert.Equal(200, exception.Response.BatchStatusCode); + Assert.Single(exception.Response); + } + + [Fact] + public virtual async Task CanSetLinksInABatchWithDataServicesClient() + { + Uri serviceUrl = new Uri(BaseAddress + "/UnbufferedBatch"); + UnbufferedBatchProxy.Container client = new UnbufferedBatchProxy.Container(serviceUrl); + client.Format.UseJson(); + + UnbufferedBatchProxy.UnbufferedBatchCustomer customer = (await client.UnbufferedBatchCustomer.ExecuteAsync()).First(); + UnbufferedBatchProxy.UnbufferedBatchOrder order = new UnbufferedBatchProxy.UnbufferedBatchOrder() { Id = 0, PurchaseDate = DateTime.Now }; + + client.AddToUnbufferedBatchOrder(order); + + client.AddLink(customer, "Orders", order); + + await client.SaveChangesAsync(SaveChangesOptions.BatchWithSingleChangeset); + } + [Fact] public async Task CanHandleAbsoluteAndRelativeUrls() { @@ -445,185 +528,14 @@ public async Task CanHandleSingleDeleteInBatch() } } - public class QueryBatchTests : WebHostTestBase - { - public QueryBatchTests(WebHostTestFixture fixture) - :base(fixture) - { - } - - protected override void UpdateConfiguration(WebRouteConfiguration configuration) - { - ODataModelBuilder builder = configuration.CreateConventionModelBuilder(); - configuration.MapODataServiceRoute( - "batch", - "UnbufferedBatch", - GetEdmModel(builder), - new DefaultODataPathHandler(), - ODataRoutingConventions.CreateDefault(), - configuration.CreateUnbufferedODataBatchHandler()); - } - - protected static IEdmModel GetEdmModel(ODataModelBuilder builder) - { - EntitySetConfiguration customers = builder.EntitySet("UnbufferedBatchCustomer"); - EntitySetConfiguration orders = builder.EntitySet("UnbufferedBatchOrder"); - customers.EntityType.Collection.Action("OddCustomers").ReturnsCollectionFromEntitySet("UnbufferedBatchCustomer"); - builder.MaxDataServiceVersion = builder.DataServiceVersion; - return builder.GetEdmModel(); - } - - [Fact] - public async Task CanBatchQueriesWithDataServicesClient() - { - Uri serviceUrl = new Uri(BaseAddress + "/UnbufferedBatch"); - UnbufferedBatchProxy.Container client = new UnbufferedBatchProxy.Container(serviceUrl); - client.Format.UseJson(); - Uri customersRequestUri = new Uri(BaseAddress + "/UnbufferedBatch/UnbufferedBatchCustomer"); - DataServiceRequest customersRequest = new DataServiceRequest(customersRequestUri); - Uri singleCustomerRequestUri = new Uri(BaseAddress + "/UnbufferedBatch/UnbufferedBatchCustomer(0)"); - DataServiceRequest singleCustomerRequest = new DataServiceRequest(singleCustomerRequestUri); - - DataServiceResponse batchResponse = await client.ExecuteBatchAsync(customersRequest, singleCustomerRequest); - - if (batchResponse.IsBatchResponse) - { - Assert.Equal(200, batchResponse.BatchStatusCode); - } - - foreach (QueryOperationResponse response in batchResponse) - { - Assert.Equal(200, response.StatusCode); - if (response.Query.RequestUri == customersRequestUri) - { - // Previous test could modify the total count to be anywhere from, 10 to 14. - Assert.InRange(response.Cast().Count(), 10, 14); - continue; - } - if (response.Query.RequestUri == singleCustomerRequestUri) - { - Assert.Single(response.Cast()); - continue; - } - } - } - } - - public class ErrorsBatchTests : WebHostTestBase - { - public ErrorsBatchTests(WebHostTestFixture fixture) - :base(fixture) - { - } - - protected override void UpdateConfiguration(WebRouteConfiguration configuration) - { - ODataModelBuilder builder = configuration.CreateConventionModelBuilder(); - configuration.MapODataServiceRoute( - "batch", - "UnbufferedBatch", - GetEdmModel(builder), - new DefaultODataPathHandler(), - ODataRoutingConventions.CreateDefault(), - configuration.CreateUnbufferedODataBatchHandler()); - } - - - protected static IEdmModel GetEdmModel(ODataModelBuilder builder) - { - EntitySetConfiguration customers = builder.EntitySet("UnbufferedBatchCustomer"); - EntitySetConfiguration orders = builder.EntitySet("UnbufferedBatchOrder"); - customers.EntityType.Collection.Action("OddCustomers").ReturnsCollectionFromEntitySet("UnbufferedBatchCustomer"); - builder.MaxDataServiceVersion = builder.DataServiceVersion; - return builder.GetEdmModel(); - } - - [Fact] - public async Task SendsIndividualErrorWhenOneOfTheRequestsFails() - { - Uri serviceUrl = new Uri(BaseAddress + "/UnbufferedBatch"); - UnbufferedBatchProxy.Container client = new UnbufferedBatchProxy.Container(serviceUrl); - client.Format.UseJson(); - - UnbufferedBatchProxy.UnbufferedBatchCustomer validCustomer = new UnbufferedBatchProxy.UnbufferedBatchCustomer() - { - Id = 10, - Name = "Customer 10" - }; - - UnbufferedBatchProxy.UnbufferedBatchCustomer invalidCustomer = new UnbufferedBatchProxy.UnbufferedBatchCustomer() - { - Id = -1, - Name = "Customer -1" - }; - - client.AddToUnbufferedBatchCustomer(validCustomer); - client.AddToUnbufferedBatchCustomer(invalidCustomer); - var exception = await Assert.ThrowsAsync(async () => - { - DataServiceResponse response = await client.SaveChangesAsync(SaveChangesOptions.BatchWithSingleChangeset); - }); - - Assert.NotNull(exception); - Assert.Equal(200, exception.Response.BatchStatusCode); - Assert.Single(exception.Response); - } - } - - public class LinksBatchTests : WebHostTestBase - { - public LinksBatchTests(WebHostTestFixture fixture) - :base(fixture) - { - } - - protected override void UpdateConfiguration(WebRouteConfiguration configuration) - { - ODataModelBuilder builder = configuration.CreateConventionModelBuilder(); - configuration.MapODataServiceRoute( - "batch", - "UnbufferedBatch", - GetEdmModel(builder), - new DefaultODataPathHandler(), - ODataRoutingConventions.CreateDefault(), - configuration.CreateUnbufferedODataBatchHandler()); - } - - protected static IEdmModel GetEdmModel(ODataModelBuilder builder) - { - EntitySetConfiguration customers = builder.EntitySet("UnbufferedBatchCustomer"); - EntitySetConfiguration orders = builder.EntitySet("UnbufferedBatchOrder"); - customers.EntityType.Collection.Action("OddCustomers").ReturnsCollectionFromEntitySet("UnbufferedBatchCustomer"); - builder.MaxDataServiceVersion = builder.DataServiceVersion; - return builder.GetEdmModel(); - } - - [Fact] - public virtual async Task CanSetLinksInABatchWithDataServicesClient() - { - Uri serviceUrl = new Uri(BaseAddress + "/UnbufferedBatch"); - UnbufferedBatchProxy.Container client = new UnbufferedBatchProxy.Container(serviceUrl); - client.Format.UseJson(); - - UnbufferedBatchProxy.UnbufferedBatchCustomer customer = (await client.UnbufferedBatchCustomer.ExecuteAsync()).First(); - UnbufferedBatchProxy.UnbufferedBatchOrder order = new UnbufferedBatchProxy.UnbufferedBatchOrder() { Id = 0, PurchaseDate = DateTime.Now }; - - client.AddToUnbufferedBatchOrder(order); - - client.AddLink(customer, "Orders", order); - - await client.SaveChangesAsync(SaveChangesOptions.BatchWithSingleChangeset); - } - } - - public class ContinueOnErrorBatchTests : WebHostTestBase + public class ContinueOnErrorBatchTests : WebHostTestBase { - public ContinueOnErrorBatchTests(WebHostTestFixture fixture) + public ContinueOnErrorBatchTests(WebHostTestFixture fixture) :base(fixture) { } - protected override void UpdateConfiguration(WebRouteConfiguration configuration) + protected static void UpdateConfigure(WebRouteConfiguration configuration) { ODataModelBuilder builder = configuration.CreateConventionModelBuilder(); configuration.MapODataServiceRoute( diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/BoundOperation/BoundOperationTest.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/BoundOperation/BoundOperationTest.cs index 38be5fee6a..f1b8035613 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/BoundOperation/BoundOperationTest.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/BoundOperation/BoundOperationTest.cs @@ -23,14 +23,14 @@ namespace Microsoft.Test.E2E.AspNet.OData.BoundOperation { - public class BoundOperationTest : WebHostTestBase + public class BoundOperationTest : WebHostTestBase { private const string CollectionOfEmployee = "Collection(NS.Employee)"; private const string CollectionOfManager = "Collection(NS.Manager)"; private const string Employee = "NS.Employee"; private const string Manager = "NS.Manager"; - public BoundOperationTest(WebHostTestFixture fixture) + public BoundOperationTest(WebHostTestFixture fixture) :base(fixture) { } @@ -43,7 +43,7 @@ private async Task ResetDatasource() return responseForPost; } - protected override void UpdateConfiguration(WebRouteConfiguration configuration) + protected static void UpdateConfigure(WebRouteConfiguration configuration) { var controllers = new[] { typeof(EmployeesController), typeof(MetadataController) }; configuration.AddControllers(controllers); diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNet/Microsoft.Test.E2E.AspNet.OData.csproj b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNet/Microsoft.Test.E2E.AspNet.OData.csproj index d584918b64..05d4167611 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNet/Microsoft.Test.E2E.AspNet.OData.csproj +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNet/Microsoft.Test.E2E.AspNet.OData.csproj @@ -301,11 +301,11 @@ Common\Execution\WebHostLogExceptionFilter.cs - - Common\Execution\WebHostTestBase.cs + + Common\Execution\WebHostTestBaseOfT.cs - - Common\Execution\WebHostTestFixture.cs + + Common\Execution\WebHostTestFixtureOfT.cs Common\Execution\WebRouteConfiguration.cs diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNetCore/DependencyInjection/CustomizeSkipTokenImplementationTest.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNetCore/DependencyInjection/CustomizeSkipTokenImplementationTest.cs index 406a4cbc60..d8e0edc9f6 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNetCore/DependencyInjection/CustomizeSkipTokenImplementationTest.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNetCore/DependencyInjection/CustomizeSkipTokenImplementationTest.cs @@ -16,17 +16,17 @@ namespace Microsoft.Test.E2E.AspNet.OData.DependencyInjection { - public class CustomizeSkipTokenImplementationTest : WebHostTestBase + public class CustomizeSkipTokenImplementationTest : WebHostTestBase { private const string CustomerBaseUrl = "{0}/customskiptoken/Customers"; private const string OrderBaseUrl = "{0}/customskiptoken/Orders"; - public CustomizeSkipTokenImplementationTest(WebHostTestFixture fixture) + public CustomizeSkipTokenImplementationTest(WebHostTestFixture fixture) : base(fixture) { } - protected override void UpdateConfiguration(WebRouteConfiguration configuration) + protected static void UpdateConfigure(WebRouteConfiguration configuration) { configuration.AddControllers(typeof(CustomersController), typeof(OrdersController)); configuration.JsonReferenceLoopHandling = diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNetCore/Microsoft.Test.E2E.AspNetCore.OData.csproj b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNetCore/Microsoft.Test.E2E.AspNetCore.OData.csproj index 6afdbcf513..8009db7711 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNetCore/Microsoft.Test.E2E.AspNetCore.OData.csproj +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNetCore/Microsoft.Test.E2E.AspNetCore.OData.csproj @@ -39,8 +39,8 @@ Common\Execution\WebHostLogExceptionFilter.cs - - Common\Execution\WebHostTestFixture.cs + + Common\Execution\WebHostTestFixtureOfT.cs Common\Extensions\HttpClientExtension.cs @@ -223,8 +223,8 @@ Common\Execution\SecurityHelper.cs - - Common\Execution\WebHostTestBase.cs + + Common\Execution\WebHostTestBaseOfT.cs Common\Execution\WebRouteConfiguration.cs diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNetCore3x/DependencyInjection/CustomizeSkipTokenImplementationTest.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNetCore3x/DependencyInjection/CustomizeSkipTokenImplementationTest.cs index 406a4cbc60..209c724f43 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNetCore3x/DependencyInjection/CustomizeSkipTokenImplementationTest.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNetCore3x/DependencyInjection/CustomizeSkipTokenImplementationTest.cs @@ -16,17 +16,16 @@ namespace Microsoft.Test.E2E.AspNet.OData.DependencyInjection { - public class CustomizeSkipTokenImplementationTest : WebHostTestBase + public class CustomizeSkipTokenImplementationTest : WebHostTestBase { private const string CustomerBaseUrl = "{0}/customskiptoken/Customers"; - private const string OrderBaseUrl = "{0}/customskiptoken/Orders"; - public CustomizeSkipTokenImplementationTest(WebHostTestFixture fixture) + public CustomizeSkipTokenImplementationTest(WebHostTestFixture fixture) : base(fixture) { } - protected override void UpdateConfiguration(WebRouteConfiguration configuration) + protected static void UpdateConfigure(WebRouteConfiguration configuration) { configuration.AddControllers(typeof(CustomersController), typeof(OrdersController)); configuration.JsonReferenceLoopHandling = diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNetCore3x/Microsoft.Test.E2E.AspNetCore3x.OData.csproj b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNetCore3x/Microsoft.Test.E2E.AspNetCore3x.OData.csproj index 140896e3ec..38d29ca788 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNetCore3x/Microsoft.Test.E2E.AspNetCore3x.OData.csproj +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNetCore3x/Microsoft.Test.E2E.AspNetCore3x.OData.csproj @@ -61,8 +61,8 @@ Common\Execution\WebHostLogExceptionFilter.cs - - Common\Execution\WebHostTestFixture.cs + + Common\Execution\WebHostTestFixtureOfT.cs Common\Extensions\HttpClientExtension.cs @@ -112,6 +112,9 @@ NavigationPropertyOnComplexType\PeopleRepository.cs + + NavigationPropertyOnComplexType\SelectImprovementOnComplexTypeTests.cs + QueryComposition\EFWideCustomer.cs @@ -235,8 +238,8 @@ Common\Execution\SecurityHelper.cs - - Common\Execution\WebHostTestBase.cs + + Common\Execution\WebHostTestBaseOfT.cs Common\Execution\WebRouteConfiguration.cs diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Cast/CastTest.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Cast/CastTest.cs index 2cdd6ea894..4e433bdb28 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Cast/CastTest.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Cast/CastTest.cs @@ -15,16 +15,16 @@ namespace Microsoft.Test.E2E.AspNet.OData.Cast { - public class CastTest : WebHostTestBase + public class CastTest : WebHostTestBase { private static string[] dataSourceTypes = new string[] { "IM", "EF" };// In Memory and Entity Framework - public CastTest(WebHostTestFixture fixture) + public CastTest(WebHostTestFixture fixture) :base(fixture) { } - protected override void UpdateConfiguration(WebRouteConfiguration configuration) + protected static void UpdateConfigure(WebRouteConfiguration configuration) { var controllers = new[] { typeof(ProductsController), typeof(MetadataController) }; configuration.AddControllers(controllers); diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Execution/WebHostTestBase.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Execution/WebHostTestBaseOfT.cs similarity index 64% rename from test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Execution/WebHostTestBase.cs rename to test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Execution/WebHostTestBaseOfT.cs index 18226d8780..52156b5ee3 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Execution/WebHostTestBase.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Execution/WebHostTestBaseOfT.cs @@ -8,18 +8,17 @@ namespace Microsoft.Test.E2E.AspNet.OData.Common.Execution { /// - /// The WebHostTestBase creates a web host to be used for a test. + /// The WebHostTestBase{TTest} creates a web host to be used for a test. + /// Important! Important! Important! if your test cases doesn't rely on a web host, must not derive from this class. /// - public abstract class WebHostTestBase : IClassFixture, IDisposable + public abstract class WebHostTestBase : IClassFixture>, IDisposable { /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// The fixture used to initialize the web service. - protected WebHostTestBase(WebHostTestFixture fixture) + protected WebHostTestBase(WebHostTestFixture fixture) { - // Initialize the fixture and get the client and base address. - fixture.Initialize(this.UpdateConfiguration); this.BaseAddress = fixture.BaseAddress; this.Client = new HttpClient(); } @@ -33,12 +32,6 @@ protected WebHostTestBase(WebHostTestFixture fixture) /// An HttpClient to use with the server. /// public HttpClient Client { get; set; } - - /// - /// A configuration method for the server. - /// - /// - protected abstract void UpdateConfiguration(WebRouteConfiguration configuration); public void Dispose() { diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Execution/WebHostTestFixture.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Execution/WebHostTestFixtureOfT.cs similarity index 79% rename from test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Execution/WebHostTestFixture.cs rename to test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Execution/WebHostTestFixtureOfT.cs index 0028d515f6..c74cc16624 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Execution/WebHostTestFixture.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Execution/WebHostTestFixtureOfT.cs @@ -5,13 +5,13 @@ using System; using System.Linq; using System.Net; +using System.Reflection; using Microsoft.AspNet.OData; using Microsoft.AspNet.OData.Extensions; using Microsoft.AspNet.OData.Query; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Http.Features; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.Filters; using Microsoft.AspNetCore.Routing; @@ -24,7 +24,7 @@ #else using System; using System.Linq; -using System.Net; +using System.Reflection; using System.Threading; using System.Web.Http; using Microsoft.Owin.Hosting; @@ -44,12 +44,26 @@ // // Using both Disable and Max Threads per this discussion: https://github.com/xunit/xunit/issues/276 // -[assembly: CollectionBehavior(CollectionBehavior.CollectionPerAssembly, MaxParallelThreads = 1)] +// [assembly: CollectionBehavior(CollectionBehavior.CollectionPerAssembly, MaxParallelThreads = 1)] namespace Microsoft.Test.E2E.AspNet.OData.Common.Execution { + public interface IWebHostTestFixture + { + /// + /// Gets or sets a value indicating whether error details should be included. + /// + bool IncludeErrorDetail { get; set; } + + /// + /// Gets the configuration action. + /// + Action ConfigurationAction { get; } + } + /// /// The WebHostTestFixture is create a web host to be used for a test. + /// Important! Important! Important! if your test cases doesn't rely on a web host, must not inject this class instance into your test constructor. /// /// /// This is a Class Fixture (see https://xunit.github.io/docs/shared-context.html). @@ -57,14 +71,12 @@ namespace Microsoft.Test.E2E.AspNet.OData.Common.Execution /// each test class has its own web server, as opposed to Collection Fixtures even though /// there is one assembly-wide collection used for serialization purposes. /// - public class WebHostTestFixture : IDisposable + public class WebHostTestFixture : IDisposable, IWebHostTestFixture { private static readonly string NormalBaseAddressTemplate = "http://{0}:{1}"; - + private int _port; private bool disposedValue = false; - private Object thisLock = new Object(); - private Action _testConfigurationAction = null; #if NETCORE private IWebHost _selfHostServer = null; @@ -73,16 +85,12 @@ public class WebHostTestFixture : IDisposable #endif /// - /// Initializes a new instance of the class + /// Initializes a new instance of the class /// which uses Katana to host a web service. /// public WebHostTestFixture() { - // We need to lazily initialize the fixture because we need the test - // configuration method and the fixture doesn't know anything about - // the test class in which is used. The first instance of a test class - // will initialize the server. This requires that the tests within a class - // are serialized. + Initialize(); } /// @@ -90,85 +98,82 @@ public WebHostTestFixture() /// public string BaseAddress { get; private set; } + /// + /// Gets the configuration action. + /// + public Action ConfigurationAction { get; private set; } + /// /// Gets or sets a value indicating whether error details should be included. /// public bool IncludeErrorDetail { get; set; } = true; + /// + /// Get the configuration method + /// + /// + private MethodInfo GetConfigurationMethod() + { + Type testType = typeof(TTest); + + return testType.GetMethod("UpdateConfigure", + BindingFlags.NonPublic | BindingFlags.Static, + null, + new Type[] { typeof(WebRouteConfiguration) }, + null); + } + /// /// Initialize the fixture. /// - /// The test configuration action. /// true of the server is initialized, false otherwise. /// /// This is done lazily to allow the update configuration /// function to be passed in from the first test class instance. /// - public bool Initialize(Action testConfigurationAction) + private void Initialize() { - SecurityHelper.AddIpListen(); - - int attempts = 0; - while (attempts++ < 3) + MethodInfo configureMethod = GetConfigurationMethod(); + if (configureMethod != null) { - try - { - if (_selfHostServer == null) - { - lock (thisLock) - { - if (_selfHostServer == null) - { -#if NETCORE - string serverName = "localhost"; -#else - string serverName = Environment.MachineName; -#endif - // setup base address - _port = PortArranger.Reserve(); - this.BaseAddress = string.Format(NormalBaseAddressTemplate, serverName, _port.ToString()); + ConfigurationAction = (Action)Delegate.CreateDelegate(typeof(Action), configureMethod); + } - // set up the server. - _testConfigurationAction = testConfigurationAction; + SecurityHelper.AddIpListen(); #if NETCORE - _selfHostServer = new WebHostBuilder() - .UseKestrel(options => - { - options.Listen(IPAddress.Loopback, _port); - }) - .UseStartup() - .ConfigureServices(services => - { - // Add ourself to the container so WebHostTestStartup - // can call UpdateConfiguration. - services.AddSingleton(this); - }) - .ConfigureLogging((hostingContext, logging) => - { - logging.AddDebug(); - logging.SetMinimumLevel(LogLevel.Warning); - }) - .Build(); - - _selfHostServer.Start(); + string serverName = "localhost"; #else - _selfHostServer = WebApp.Start(this.BaseAddress, DefaultKatanaConfigure); + string serverName = Environment.MachineName; #endif - } - } - } + // setup base address + _port = PortArranger.Reserve(); + this.BaseAddress = string.Format(NormalBaseAddressTemplate, serverName, _port.ToString()); - return true; - } - catch (HttpListenerException) +#if NETCORE + _selfHostServer = new WebHostBuilder() + .UseKestrel(options => { - // Retry HttpListenerException up to 3 times. - _selfHostServer = null; - } - } + options.Listen(IPAddress.Loopback, _port); + }) + .UseStartup() + .ConfigureServices(services => + { + // Add ourself to the container so WebHostTestStartup + // can call UpdateConfiguration. + services.AddSingleton(this); + }) + .ConfigureLogging((hostingContext, logging) => + { + logging.AddDebug(); + logging.SetMinimumLevel(LogLevel.Warning); + }) + .Build(); - throw new TimeoutException(string.Format("Unable to start server after {0} attempts", attempts)); + _selfHostServer.Start(); +#else + _selfHostServer = WebApp.Start(this.BaseAddress, DefaultKatanaConfigure); +#endif } /// @@ -193,7 +198,7 @@ protected virtual void Dispose(bool disposing) { #if NETCORE _selfHostServer.StopAsync(); - _selfHostServer.WaitForShutdown(); + _selfHostServer.WaitForShutdownAsync(); #endif _selfHostServer.Dispose(); _selfHostServer = null; @@ -258,8 +263,8 @@ public void Configure(IApplicationBuilder app, IWebHostEnvironment env) try { // Write error by default. - WebHostTestFixture testBase = context.RequestServices.GetService(); - if (testBase == null || testBase.IncludeErrorDetail) + IWebHostTestFixture fixture = context.RequestServices.GetService(); + if (fixture == null || fixture.IncludeErrorDetail) { context.Response.Clear(); context.Response.StatusCode = 500; @@ -283,11 +288,14 @@ public void Configure(IApplicationBuilder app, IWebHostEnvironment env) // Apply test configuration. WebRouteConfiguration config = new WebRouteConfiguration(routeBuilder); - WebHostTestFixture testBase = routeBuilder.ServiceProvider.GetRequiredService(); - testBase?._testConfigurationAction(config); + IWebHostTestFixture fixture = routeBuilder.ServiceProvider.GetRequiredService(); + if (fixture != null && fixture.ConfigurationAction != null) + { + fixture.ConfigurationAction(config); + } // Apply error details - testBase.IncludeErrorDetail = config.IncludeErrorDetail; + fixture.IncludeErrorDetail = config.IncludeErrorDetail; // Apply MvcActions Options. IOptions options = routeBuilder.ServiceProvider.GetService>(); @@ -459,7 +467,10 @@ private void DefaultKatanaConfigure(IAppBuilder app) var httpServer = new HttpServer(configuration); configuration.SetHttpServer(httpServer); - _testConfigurationAction(configuration); + if (ConfigurationAction != null) + { + ConfigurationAction(configuration); + } app.UseWebApi(httpServer: httpServer); } diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/ODataTestExtension.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/ODataTestExtension.cs index 8f142946fc..a518d7a25c 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/ODataTestExtension.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/ODataTestExtension.cs @@ -42,7 +42,7 @@ namespace Microsoft.Test.E2E.AspNet.OData.Common { public static class ODataTestExtension { - public static Task ClearRepositoryAsync(this WebHostTestBase test, string entityName) + public static Task ClearRepositoryAsync(this WebHostTestBase test, string entityName) { return test.Client.DeleteAsync(test.BaseAddress + "/" + entityName); } diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ComplexTypeInheritance/ComplexTypeInheritanceSerializeTest.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ComplexTypeInheritance/ComplexTypeInheritanceSerializeTest.cs index 08bfa420c4..89d4c94ce2 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ComplexTypeInheritance/ComplexTypeInheritanceSerializeTest.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ComplexTypeInheritance/ComplexTypeInheritanceSerializeTest.cs @@ -19,14 +19,14 @@ namespace Microsoft.Test.E2E.AspNet.OData.ComplexTypeInheritance { - public class ComplexTypeInheritanceSerializeTest : WebHostTestBase + public class ComplexTypeInheritanceSerializeTest : WebHostTestBase { - public ComplexTypeInheritanceSerializeTest(WebHostTestFixture fixture) + public ComplexTypeInheritanceSerializeTest(WebHostTestFixture fixture) :base(fixture) { } - protected override void UpdateConfiguration(WebRouteConfiguration configuration) + protected static void UpdateConfigure(WebRouteConfiguration configuration) { var controllers = new[] { typeof(MetadataController), typeof(InheritanceCustomersController) }; configuration.AddControllers(controllers); diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ComplexTypeInheritance/ComplexTypeInheritanceTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ComplexTypeInheritance/ComplexTypeInheritanceTests.cs index 4a88640e6c..d5cc0cece0 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ComplexTypeInheritance/ComplexTypeInheritanceTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ComplexTypeInheritance/ComplexTypeInheritanceTests.cs @@ -18,9 +18,9 @@ namespace Microsoft.Test.E2E.AspNet.OData.ComplexTypeInheritance { - public class ComplexTypeInheritanceTests : WebHostTestBase + public class ComplexTypeInheritanceTests : WebHostTestBase { - public ComplexTypeInheritanceTests(WebHostTestFixture fixture) + public ComplexTypeInheritanceTests(WebHostTestFixture fixture) :base(fixture) { } @@ -93,8 +93,7 @@ public static TheoryDataSet PostToCollectionNewComp } } - - protected override void UpdateConfiguration(WebRouteConfiguration configuration) + protected static void UpdateConfigure(WebRouteConfiguration configuration) { var controllers = new[] { typeof(WindowsController), typeof(MetadataController) }; configuration.AddControllers(controllers); diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Containment/ContainmentTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Containment/ContainmentTests.cs index f0ee2a6bc8..aac246f5ad 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Containment/ContainmentTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Containment/ContainmentTests.cs @@ -45,9 +45,9 @@ namespace Microsoft.Test.E2E.AspNet.OData.Containment { - public class ContainmentTests : WebHostTestBase + public class ContainmentTests : WebHostTestBase { - public ContainmentTests(WebHostTestFixture fixture) + public ContainmentTests(WebHostTestFixture fixture) :base(fixture) { } @@ -75,7 +75,7 @@ public static TheoryDataSet MediaTypes } } - protected override void UpdateConfiguration(WebRouteConfiguration configuration) + protected static void UpdateConfigure(WebRouteConfiguration configuration) { var controllers = new[] { typeof(AccountsController), typeof(AnonymousAccountController), typeof(MetadataController) }; configuration.AddControllers(controllers); diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DateAndTimeOfDay/DateAndTimeOfDayTest.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DateAndTimeOfDay/DateAndTimeOfDayTest.cs index 8b4c8ae08c..8f69bcaadb 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DateAndTimeOfDay/DateAndTimeOfDayTest.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DateAndTimeOfDay/DateAndTimeOfDayTest.cs @@ -22,14 +22,14 @@ namespace Microsoft.Test.E2E.AspNet.OData.DateAndTimeOfDay { - public class DateAndTimeOfDayTest : WebHostTestBase + public class DateAndTimeOfDayTest : WebHostTestBase { - public DateAndTimeOfDayTest(WebHostTestFixture fixture) + public DateAndTimeOfDayTest(WebHostTestFixture fixture) :base(fixture) { } - protected override void UpdateConfiguration(WebRouteConfiguration configuration) + protected static void UpdateConfigure(WebRouteConfiguration configuration) { var controllers = new[] { typeof(DCustomersController), typeof(MetadataController), typeof(EfCustomersController) }; configuration.AddControllers(controllers); diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DateAndTimeOfDay/DateAndTimeOfDayWithEfTest.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DateAndTimeOfDay/DateAndTimeOfDayWithEfTest.cs index 2aa4a029b2..61feb6d084 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DateAndTimeOfDay/DateAndTimeOfDayWithEfTest.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DateAndTimeOfDay/DateAndTimeOfDayWithEfTest.cs @@ -23,14 +23,14 @@ namespace Microsoft.Test.E2E.AspNet.OData.DateAndTimeOfDay { - public class DateAndTimeOfDayWithEfTest : WebHostTestBase + public class DateAndTimeOfDayWithEfTest : WebHostTestBase { - public DateAndTimeOfDayWithEfTest(WebHostTestFixture fixture) + public DateAndTimeOfDayWithEfTest(WebHostTestFixture fixture) :base(fixture) { } - protected override void UpdateConfiguration(WebRouteConfiguration configuration) + protected static void UpdateConfigure(WebRouteConfiguration configuration) { var controllers = new[] { typeof(MetadataController), typeof(DateAndTimeOfDayModelsController) }; configuration.AddControllers(controllers); diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DateAndTimeOfDay/DateWithEfTest.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DateAndTimeOfDay/DateWithEfTest.cs index 5f934f4d89..0d0631740a 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DateAndTimeOfDay/DateWithEfTest.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DateAndTimeOfDay/DateWithEfTest.cs @@ -16,14 +16,14 @@ namespace Microsoft.Test.E2E.AspNet.OData.DateAndTimeOfDay { - public class DateWithEfTest : WebHostTestBase + public class DateWithEfTest : WebHostTestBase { - public DateWithEfTest(WebHostTestFixture fixture) + public DateWithEfTest(WebHostTestFixture fixture) :base(fixture) { } - protected override void UpdateConfiguration(WebRouteConfiguration configuration) + protected static void UpdateConfigure(WebRouteConfiguration configuration) { var controllers = new[] {typeof (EfPeopleController)}; configuration.AddControllers(controllers); diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DateTimeSupport/DateTimeTest.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DateTimeSupport/DateTimeTest.cs index 7369f1a517..1b38ca89d2 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DateTimeSupport/DateTimeTest.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DateTimeSupport/DateTimeTest.cs @@ -21,14 +21,14 @@ namespace Microsoft.Test.E2E.AspNet.OData.DateTimeSupport { - public class DateTimeTest : WebHostTestBase + public class DateTimeTest : WebHostTestBase { - public DateTimeTest(WebHostTestFixture fixture) + public DateTimeTest(WebHostTestFixture fixture) :base(fixture) { } - protected override void UpdateConfiguration(WebRouteConfiguration configuration) + protected static void UpdateConfigure(WebRouteConfiguration configuration) { var controllers = new[] { typeof(FilesController), typeof(MetadataController) }; configuration.AddControllers(controllers); diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DeltaQueryTests/DeltaQueryTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DeltaQueryTests/DeltaQueryTests.cs index 744e7391f1..a9689f6db6 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DeltaQueryTests/DeltaQueryTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DeltaQueryTests/DeltaQueryTests.cs @@ -21,14 +21,14 @@ namespace Microsoft.Test.E2E.AspNet.OData { - public class DeltaQueryTests : WebHostTestBase + public class DeltaQueryTests : WebHostTestBase { - public DeltaQueryTests(WebHostTestFixture fixture) + public DeltaQueryTests(WebHostTestFixture fixture) :base(fixture) { } - protected override void UpdateConfiguration(WebRouteConfiguration config) + protected static void UpdateConfigure(WebRouteConfiguration config) { config.Routes.Clear(); config.MapODataServiceRoute("odata", "odata", GetModel(config), new DefaultODataPathHandler(), ODataRoutingConventions.CreateDefault()); diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DependencyInjection/CustomizeCountQueryValidatorTest.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DependencyInjection/CustomizeCountQueryValidatorTest.cs index 41d796dc0f..590c599ecc 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DependencyInjection/CustomizeCountQueryValidatorTest.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DependencyInjection/CustomizeCountQueryValidatorTest.cs @@ -16,17 +16,17 @@ namespace Microsoft.Test.E2E.AspNet.OData.DependencyInjection { - public class CustomizeCountQueryValidatorTest : WebHostTestBase + public class CustomizeCountQueryValidatorTest : WebHostTestBase { private const string CustomerBaseUrl = "{0}/customcountvalidator/Customers"; private const string OrderBaseUrl = "{0}/customcountvalidator/Orders"; - public CustomizeCountQueryValidatorTest(WebHostTestFixture fixture) + public CustomizeCountQueryValidatorTest(WebHostTestFixture fixture) :base(fixture) { } - protected override void UpdateConfiguration(WebRouteConfiguration configuration) + protected static void UpdateConfigure(WebRouteConfiguration configuration) { configuration.AddControllers(typeof(CustomersController), typeof(OrdersController)); configuration.JsonReferenceLoopHandling = diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DependencyInjection/CustomizeSerializerTest.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DependencyInjection/CustomizeSerializerTest.cs index 9cfc60878f..943af64ec3 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DependencyInjection/CustomizeSerializerTest.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DependencyInjection/CustomizeSerializerTest.cs @@ -18,16 +18,16 @@ namespace Microsoft.Test.E2E.AspNet.OData.DependencyInjection { - public class CustomizeSerializerTest : WebHostTestBase + public class CustomizeSerializerTest : WebHostTestBase { private const string CustomerBaseUrl = "{0}/customserializer/Customers"; - public CustomizeSerializerTest(WebHostTestFixture fixture) + public CustomizeSerializerTest(WebHostTestFixture fixture) :base(fixture) { } - protected override void UpdateConfiguration(WebRouteConfiguration configuration) + protected static void UpdateConfigure(WebRouteConfiguration configuration) { configuration.AddControllers(typeof(CustomersController), typeof(OrdersController)); configuration.JsonReferenceLoopHandling = diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DollarFormat/DollarFormatOverrideAcceptMediaTypeTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DollarFormat/DollarFormatOverrideAcceptMediaTypeTests.cs index 1d1d225450..19c893c940 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DollarFormat/DollarFormatOverrideAcceptMediaTypeTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DollarFormat/DollarFormatOverrideAcceptMediaTypeTests.cs @@ -19,9 +19,9 @@ namespace Microsoft.Test.E2E.AspNet.OData.DollarFormat { - public class DollarFormatOverrideAcceptMediaTypeTests : WebHostTestBase + public class DollarFormatOverrideAcceptMediaTypeTests : WebHostTestBase { - public DollarFormatOverrideAcceptMediaTypeTests(WebHostTestFixture fixture) + public DollarFormatOverrideAcceptMediaTypeTests(WebHostTestFixture fixture) :base(fixture) { } @@ -190,7 +190,7 @@ public static TheoryDataSet MetadataDocumentMediaTypes } } - protected override void UpdateConfiguration(WebRouteConfiguration configuration) + protected static void UpdateConfigure(WebRouteConfiguration configuration) { configuration.Routes.Clear(); configuration.Count().Filter().OrderBy().Expand().MaxTop(null).Select(); diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DollarFormat/DollarFormatWithoutAcceptMediaTypeTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DollarFormat/DollarFormatWithoutAcceptMediaTypeTests.cs index 8df62a1598..572bcb3d9f 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DollarFormat/DollarFormatWithoutAcceptMediaTypeTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DollarFormat/DollarFormatWithoutAcceptMediaTypeTests.cs @@ -17,9 +17,9 @@ namespace Microsoft.Test.E2E.AspNet.OData.DollarFormat { - public class DollarFormatWithoutAcceptMediaTypeTests : WebHostTestBase + public class DollarFormatWithoutAcceptMediaTypeTests : WebHostTestBase { - public DollarFormatWithoutAcceptMediaTypeTests(WebHostTestFixture fixture) + public DollarFormatWithoutAcceptMediaTypeTests(WebHostTestFixture fixture) :base(fixture) { } @@ -112,7 +112,7 @@ public static TheoryDataSet MetadataDocumentMediaTypes } } - protected override void UpdateConfiguration(WebRouteConfiguration configuration) + protected static void UpdateConfigure(WebRouteConfiguration configuration) { configuration.Routes.Clear(); configuration.Count().Filter().OrderBy().Expand().MaxTop(null).Select(); diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DollarId/DollarIdClientTest.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DollarId/DollarIdClientTest.cs index 96c537f86a..e67cb77a33 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DollarId/DollarIdClientTest.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DollarId/DollarIdClientTest.cs @@ -14,14 +14,14 @@ namespace Microsoft.Test.E2E.AspNet.OData.DollarId { - public class DollarIdClientTest : WebHostTestBase + public class DollarIdClientTest : WebHostTestBase { - public DollarIdClientTest(WebHostTestFixture fixture) + public DollarIdClientTest(WebHostTestFixture fixture) :base(fixture) { } - protected override void UpdateConfiguration(WebRouteConfiguration configuration) + protected static void UpdateConfigure(WebRouteConfiguration configuration) { var controllers = new[] { typeof(SingersController), typeof(AlbumsController), typeof(MetadataController) }; configuration.AddControllers(controllers); @@ -38,6 +38,7 @@ public async Task DeleteNavigationLink() var clientContext = new Client.Default.Container(new Uri(serviceRoot)); clientContext.MergeOption = MergeOption.OverwriteChanges; + // Key value "0" is for DollarIdClientTest. var singer = await Task.Factory.FromAsync(clientContext.Singers.BeginExecute(null, null), (asyncResult) => { return clientContext.Singers.EndExecute(asyncResult).Where(s => s.ID == 0).Single(); @@ -82,7 +83,7 @@ public async Task DeleteContainedNavigationLink() Assert.Single(album.Sales); } - // [Fact(Skip = "Used to generate csdl file")] + //[Fact(Skip = "Used to generate csdl file")] internal void GetMetadata() { var directory = Directory.GetCurrentDirectory(); diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DollarId/DollarIdControllers.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DollarId/DollarIdControllers.cs index 505e636287..5d762b0097 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DollarId/DollarIdControllers.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DollarId/DollarIdControllers.cs @@ -57,6 +57,7 @@ public ITestActionResult DeleteRef(int key, int relatedKey, string navigationPro return BadRequest(); } + // Removing "album" maybe side-effect with other test cases. singer.Albums.Remove(album); return StatusCode(HttpStatusCode.NoContent); } diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DollarId/DollarIdTest.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DollarId/DollarIdTest.cs index d04d115edf..3d968538a6 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DollarId/DollarIdTest.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DollarId/DollarIdTest.cs @@ -11,14 +11,14 @@ namespace Microsoft.Test.E2E.AspNet.OData.DollarId { - public class DollarIdTest : WebHostTestBase + public class DollarIdTest : WebHostTestBase { - public DollarIdTest(WebHostTestFixture fixture) + public DollarIdTest(WebHostTestFixture fixture) :base(fixture) { } - protected override void UpdateConfiguration(WebRouteConfiguration configuration) + protected static void UpdateConfigure(WebRouteConfiguration configuration) { var controllers = new[] { typeof(SingersController), typeof(AlbumsController) }; configuration.AddControllers(controllers); @@ -67,7 +67,7 @@ public async Task DeleteContainedNavigationLink() var response = await this.Client.DeleteAsync(string.Format(requestBaseUri + "/$ref?$id={0}/Albums(1)/Sales(2)", this.BaseAddress)); Assert.Equal(HttpStatusCode.NoContent, response.StatusCode); - //GET Singers(1)/Albums + //GET Albums(1)/Sales response = await this.Client.GetAsync(requestBaseUri); var json = await response.Content.ReadAsObject(); var result = json["value"] as JArray; @@ -76,7 +76,7 @@ public async Task DeleteContainedNavigationLink() response = await this.Client.DeleteAsync(string.Format(requestBaseUri + "/$ref?$id=../../Albums(1)/Sales(3)", this.BaseAddress)); Assert.Equal(HttpStatusCode.NoContent, response.StatusCode); - //GET Singers(1)/Albums + // GET Albums(1)/Sales response = await this.Client.GetAsync(requestBaseUri); json = await response.Content.ReadAsObject(); result = json["value"] as JArray; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DollarLevels/DollarLevelsTest.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DollarLevels/DollarLevelsTest.cs index f4648131fa..891a711424 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DollarLevels/DollarLevelsTest.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DollarLevels/DollarLevelsTest.cs @@ -12,16 +12,16 @@ namespace Microsoft.Test.E2E.AspNet.OData.DollarLevels { - public class DollarLevelsTest : WebHostTestBase + public class DollarLevelsTest : WebHostTestBase { private const string NameSpace = "Microsoft.Test.E2E.AspNet.OData.DollarLevels"; - public DollarLevelsTest(WebHostTestFixture fixture) + public DollarLevelsTest(WebHostTestFixture fixture) :base(fixture) { } - protected override void UpdateConfiguration(WebRouteConfiguration configuration) + protected static void UpdateConfigure(WebRouteConfiguration configuration) { var controllers = new[] { typeof(DLManagersController), typeof(DLEmployeesController) }; configuration.AddControllers(controllers); diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ETags/DeleteUpdatedEntryWithIfMatchETagsTest.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ETags/DeleteUpdatedEntryWithIfMatchETagsTest.cs index d93519f207..c2b1af2174 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ETags/DeleteUpdatedEntryWithIfMatchETagsTest.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ETags/DeleteUpdatedEntryWithIfMatchETagsTest.cs @@ -17,14 +17,14 @@ namespace Microsoft.Test.E2E.AspNet.OData.ETags { - public class DeleteUpdatedEntryWithIfMatchETagsTest : WebHostTestBase + public class DeleteUpdatedEntryWithIfMatchETagsTest : WebHostTestBase { - public DeleteUpdatedEntryWithIfMatchETagsTest(WebHostTestFixture fixture) + public DeleteUpdatedEntryWithIfMatchETagsTest(WebHostTestFixture fixture) :base(fixture) { } - protected override void UpdateConfiguration(WebRouteConfiguration configuration) + protected static void UpdateConfigure(WebRouteConfiguration configuration) { configuration.Routes.Clear(); configuration.Count().Filter().OrderBy().Expand().MaxTop(null); diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ETags/DerivedETagTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ETags/DerivedETagTests.cs index ae6344ddc3..f2b9028fcb 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ETags/DerivedETagTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ETags/DerivedETagTests.cs @@ -18,14 +18,14 @@ namespace Microsoft.Test.E2E.AspNet.OData.ETags { - public class DerivedETagTests : WebHostTestBase + public class DerivedETagTests : WebHostTestBase { - public DerivedETagTests(WebHostTestFixture fixture) + public DerivedETagTests(WebHostTestFixture fixture) :base(fixture) { } - protected override void UpdateConfiguration(WebRouteConfiguration configuration) + protected static void UpdateConfigure(WebRouteConfiguration configuration) { configuration.Routes.Clear(); configuration.Count().Filter().OrderBy().Expand().Select().MaxTop(null); diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ETags/ETagCurrencyTokenEfContextTest.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ETags/ETagCurrencyTokenEfContextTest.cs index a32c4cec3e..798da632cb 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ETags/ETagCurrencyTokenEfContextTest.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ETags/ETagCurrencyTokenEfContextTest.cs @@ -11,14 +11,14 @@ namespace Microsoft.Test.E2E.AspNet.OData.ETags { - public class ETagCurrencyTokenEfContextTest : WebHostTestBase + public class ETagCurrencyTokenEfContextTest : WebHostTestBase { - public ETagCurrencyTokenEfContextTest(WebHostTestFixture fixture) + public ETagCurrencyTokenEfContextTest(WebHostTestFixture fixture) :base(fixture) { } - protected override void UpdateConfiguration(WebRouteConfiguration configuration) + protected static void UpdateConfigure(WebRouteConfiguration configuration) { var controllers = new[] { typeof(DominiosController)}; configuration.AddControllers(controllers); diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ETags/ETagsController.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ETags/ETagsController.cs index 7f273fc24d..592bd9da1f 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ETags/ETagsController.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ETags/ETagsController.cs @@ -33,6 +33,8 @@ public ITestActionResult Get() } } + // Be noted, "Put" , "Patch" & "Delete" method updates the "Static" customers. + // Pay attention to create E2E test cases targeting this Controller running in Parallel. public class ETagsCustomersController : TestODataController { internal static IList customers = Enumerable.Range(0, 10).Select(i => Helpers.CreateCustomer(i)).ToList(); diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ETags/ETagsOtherTypesTest.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ETags/ETagsOtherTypesTest.cs index 16d803a42b..11c5e51126 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ETags/ETagsOtherTypesTest.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ETags/ETagsOtherTypesTest.cs @@ -21,14 +21,14 @@ namespace Microsoft.Test.E2E.AspNet.OData.ETags { - public class ETagsOtherTypesTest : WebHostTestBase + public class ETagsOtherTypesTest : WebHostTestBase { - public ETagsOtherTypesTest(WebHostTestFixture fixture) + public ETagsOtherTypesTest(WebHostTestFixture fixture) :base(fixture) { } - protected override void UpdateConfiguration(WebRouteConfiguration configuration) + protected static void UpdateConfigure(WebRouteConfiguration configuration) { configuration.Routes.Clear(); configuration.Count().Filter().OrderBy().Expand().MaxTop(null); diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ETags/ETagsUntypedTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ETags/ETagsUntypedTests.cs index 1d0cfd8d5f..328a59198d 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ETags/ETagsUntypedTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ETags/ETagsUntypedTests.cs @@ -22,14 +22,14 @@ namespace Microsoft.Test.E2E.AspNet.OData.ETags { - public class ETagsUntypedTests : WebHostTestBase + public class ETagsUntypedTests : WebHostTestBase { - public ETagsUntypedTests(WebHostTestFixture fixture) + public ETagsUntypedTests(WebHostTestFixture fixture) :base(fixture) { } - protected override void UpdateConfiguration(WebRouteConfiguration configuration) + protected static void UpdateConfigure(WebRouteConfiguration configuration) { configuration.Routes.Clear(); configuration.Count().Filter().OrderBy().Expand().MaxTop(null); diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ETags/GetEntryWithIfNoneMatchETagsTest.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ETags/GetEntryWithIfNoneMatchETagsTest.cs index 72007bc8e0..60f7427804 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ETags/GetEntryWithIfNoneMatchETagsTest.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ETags/GetEntryWithIfNoneMatchETagsTest.cs @@ -16,14 +16,14 @@ namespace Microsoft.Test.E2E.AspNet.OData.ETags { - public class GetEntryWithIfNoneMatchETagsTest : WebHostTestBase + public class GetEntryWithIfNoneMatchETagsTest : WebHostTestBase { - public GetEntryWithIfNoneMatchETagsTest(WebHostTestFixture fixture) + public GetEntryWithIfNoneMatchETagsTest(WebHostTestFixture fixture) :base(fixture) { } - protected override void UpdateConfiguration(WebRouteConfiguration configuration) + protected static void UpdateConfigure(WebRouteConfiguration configuration) { configuration.Routes.Clear(); configuration.Count().Filter().OrderBy().Expand().MaxTop(null); diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ETags/JsonETagsTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ETags/JsonETagsTests.cs index f3e40a5202..3634076034 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ETags/JsonETagsTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ETags/JsonETagsTests.cs @@ -23,14 +23,14 @@ namespace Microsoft.Test.E2E.AspNet.OData.ETags { - public class JsonETagsTests : WebHostTestBase + public class JsonETagsTests : WebHostTestBase { - public JsonETagsTests(WebHostTestFixture fixture) + public JsonETagsTests(WebHostTestFixture fixture) :base(fixture) { } - protected override void UpdateConfiguration(WebRouteConfiguration configuration) + protected static void UpdateConfigure(WebRouteConfiguration configuration) { configuration.Routes.Clear(); configuration.Count().Filter().OrderBy().Expand().MaxTop(null); @@ -153,7 +153,7 @@ public async Task JsonWithDifferentMetadataLevelsHaveSameETagsTest(string metada { // { "0", ",MA==,Mi4w," }, // DeleteUpdatedEntryWithIfMatchETagsTests will change #"0" customer // { "1", ",MA==,NC4w," }, // PutUpdatedEntryWithIfMatchETagsTests will change #"1"customer - // { "2", ",MA==,Ni4w," }, // PatchUpdatedEntryWithIfMatchETagsTest will change #"2" cusotmer + // { "2", ",MA==,Ni4w," }, // PatchUpdatedEntryWithIfMatchETagsTest will change #"2" customer { "3", ",MA==,OC4w," }, { "4", ",MA==,MTAuMA==," }, { "5", ",MA==,MTIuMA==," }, diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ETags/PatchUpdatedEntryWithIfMatchETagsTest.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ETags/PatchUpdatedEntryWithIfMatchETagsTest.cs index e03671d972..e7e332d5a2 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ETags/PatchUpdatedEntryWithIfMatchETagsTest.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ETags/PatchUpdatedEntryWithIfMatchETagsTest.cs @@ -35,14 +35,14 @@ namespace Microsoft.Test.E2E.AspNet.OData.ETags { - public class PatchUpdatedEntryWithIfMatchETagsTest : WebHostTestBase + public class PatchUpdatedEntryWithIfMatchETagsTest : WebHostTestBase { - public PatchUpdatedEntryWithIfMatchETagsTest(WebHostTestFixture fixture) + public PatchUpdatedEntryWithIfMatchETagsTest(WebHostTestFixture fixture) :base(fixture) { } - protected override void UpdateConfiguration(WebRouteConfiguration configuration) + protected static void UpdateConfigure(WebRouteConfiguration configuration) { configuration.Routes.Clear(); var model = GetEdmModel(configuration); diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ETags/PutUpdatedEntryWithIfMatchETagsTest.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ETags/PutUpdatedEntryWithIfMatchETagsTest.cs index 8d0f95bd43..3a8849660a 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ETags/PutUpdatedEntryWithIfMatchETagsTest.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ETags/PutUpdatedEntryWithIfMatchETagsTest.cs @@ -18,14 +18,14 @@ namespace Microsoft.Test.E2E.AspNet.OData.ETags { - public class PutUpdatedEntryWithIfMatchETagsTest : WebHostTestBase + public class PutUpdatedEntryWithIfMatchETagsTest : WebHostTestBase { - public PutUpdatedEntryWithIfMatchETagsTest(WebHostTestFixture fixture) + public PutUpdatedEntryWithIfMatchETagsTest(WebHostTestFixture fixture) :base(fixture) { } - protected override void UpdateConfiguration(WebRouteConfiguration configuration) + protected static void UpdateConfigure(WebRouteConfiguration configuration) { configuration.Routes.Clear(); configuration.Count().Filter().OrderBy().Expand().MaxTop(null); diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/EntitySetAggregation/EntitySetAggregationTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/EntitySetAggregation/EntitySetAggregationTests.cs index 48d7e39f38..0eeeabe8e8 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/EntitySetAggregation/EntitySetAggregationTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/EntitySetAggregation/EntitySetAggregationTests.cs @@ -13,16 +13,16 @@ namespace Microsoft.Test.E2E.AspNet.OData.EntitySetAggregation { - public class EntitySetAggregationTests : WebHostTestBase + public class EntitySetAggregationTests : WebHostTestBase { private const string AggregationTestBaseUrl = "{0}/aggregation/Customers"; - public EntitySetAggregationTests(WebHostTestFixture fixture) + public EntitySetAggregationTests(WebHostTestFixture fixture) : base(fixture) { } - protected override void UpdateConfiguration(WebRouteConfiguration configuration) + protected static void UpdateConfigure(WebRouteConfiguration configuration) { configuration.AddControllers(typeof(CustomersController)); configuration.JsonReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Ignore; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Enums/EnumsTest.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Enums/EnumsTest.cs index e3734976ac..461f535f54 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Enums/EnumsTest.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Enums/EnumsTest.cs @@ -22,14 +22,14 @@ namespace Microsoft.Test.E2E.AspNet.OData.Enums { - public class EnumsTest : WebHostTestBase + public class EnumsTest : WebHostTestBase { - public EnumsTest(WebHostTestFixture fixture) + public EnumsTest(WebHostTestFixture fixture) :base(fixture) { } - protected override void UpdateConfiguration(WebRouteConfiguration configuration) + protected static void UpdateConfigure(WebRouteConfiguration configuration) { var controllers = new[] { typeof(EmployeesController), typeof(MetadataController) }; configuration.AddControllers(controllers); diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ForeignKey/ForeignKeyTest.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ForeignKey/ForeignKeyTest.cs index 5da7e98fb6..07bfa933cd 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ForeignKey/ForeignKeyTest.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ForeignKey/ForeignKeyTest.cs @@ -17,14 +17,14 @@ namespace Microsoft.Test.E2E.AspNet.OData.ForeignKey { - public class ForeignKeyTest : WebHostTestBase + public class ForeignKeyTest : WebHostTestBase { - public ForeignKeyTest(WebHostTestFixture fixture) + public ForeignKeyTest(WebHostTestFixture fixture) :base(fixture) { } - protected override void UpdateConfiguration(WebRouteConfiguration configuration) + protected static void UpdateConfigure(WebRouteConfiguration configuration) { var controllers = new[] { typeof(ForeignKeyCustomersController), typeof(ForeignKeyOrdersController), diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/BaseAddressFactoryTest.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/BaseAddressFactoryTest.cs index 4d802a0e4d..3314c04628 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/BaseAddressFactoryTest.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/BaseAddressFactoryTest.cs @@ -33,14 +33,14 @@ public ITestActionResult Get() } } - public class BaseAddressFactoryTest : WebHostTestBase + public class BaseAddressFactoryTest : WebHostTestBase { - public BaseAddressFactoryTest(WebHostTestFixture fixture) + public BaseAddressFactoryTest(WebHostTestFixture fixture) :base(fixture) { } - protected override void UpdateConfiguration(WebRouteConfiguration configuration) + protected static void UpdateConfigure(WebRouteConfiguration configuration) { var controllers = new[] { typeof(BaseAddressFactoryModelsController) }; configuration.AddControllers(controllers); diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/CollectionPropertyTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/CollectionPropertyTests.cs index bf6fcf975d..cc62b935a2 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/CollectionPropertyTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/CollectionPropertyTests.cs @@ -42,9 +42,9 @@ public CollectionProperty_EntityController() } } - public abstract class CollectionPropertyTests : ODataFormatterTestBase + public abstract class CollectionPropertyTests : ODataFormatterTestBase { - public CollectionPropertyTests(WebHostTestFixture fixture) + public CollectionPropertyTests(WebHostTestFixture fixture) :base(fixture) { } diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/ComplexTypeTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/ComplexTypeTests.cs index f48799fec7..8c24e9b7bd 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/ComplexTypeTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/ComplexTypeTests.cs @@ -39,9 +39,9 @@ public ComplexTypeTests_EntityController() } } - public abstract class ComplexTypeTests : ODataFormatterTestBase + public abstract class ComplexTypeTests : ODataFormatterTestBase { - public ComplexTypeTests(WebHostTestFixture fixture) + public ComplexTypeTests(WebHostTestFixture fixture) :base(fixture) { } diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/DeltaTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/DeltaTests.cs index 9542d4aea8..06c9df7654 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/DeltaTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/DeltaTests.cs @@ -197,9 +197,9 @@ public override PropertyDescriptorCollection GetProperties(Attribute[] attribute } } - public abstract class DeltaTests : ODataFormatterTestBase + public abstract class DeltaTests : ODataFormatterTestBase { - public DeltaTests(WebHostTestFixture fixture) + public DeltaTests(WebHostTestFixture fixture) :base(fixture) { } @@ -328,14 +328,14 @@ public static Type ResolveType(string name) } } - public class PutDeltaOfTTests : WebHostTestBase + public class PutDeltaOfTTests : WebHostTestBase { - public PutDeltaOfTTests(WebHostTestFixture fixture) + public PutDeltaOfTTests(WebHostTestFixture fixture) :base(fixture) { } - protected override void UpdateConfiguration(WebRouteConfiguration config) + protected static void UpdateConfigure(WebRouteConfiguration config) { config.Routes.Clear(); config.Count().Filter().OrderBy().Expand().MaxTop(null).Select(); @@ -366,14 +366,14 @@ public async Task PutShouldntOverrideNavigationProperties() } } - public class PatchtDeltaOfTTests : WebHostTestBase + public class PatchDeltaOfTTests : WebHostTestBase { - public PatchtDeltaOfTTests(WebHostTestFixture fixture) + public PatchDeltaOfTTests(WebHostTestFixture fixture) :base(fixture) { } - protected override void UpdateConfiguration(WebRouteConfiguration config) + protected static void UpdateConfigure(WebRouteConfiguration config) { config.Routes.Clear(); config.Count().Filter().OrderBy().Expand().MaxTop(null).Select(); diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/ErrorMessagesTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/ErrorMessagesTests.cs index ebd1ebf525..92cd56db9f 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/ErrorMessagesTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/ErrorMessagesTests.cs @@ -14,14 +14,14 @@ namespace Microsoft.Test.E2E.AspNet.OData.Formatter { - public class ErrorMessagesTests : WebHostTestBase + public class ErrorMessagesTests : WebHostTestBase { - public ErrorMessagesTests(WebHostTestFixture fixture) + public ErrorMessagesTests(WebHostTestFixture fixture) :base(fixture) { } - protected override void UpdateConfiguration(WebRouteConfiguration config) + protected static void UpdateConfigure(WebRouteConfiguration config) { config.Routes.Clear(); config.MapODataServiceRoute("odata", "odata", GetModel(config), new DefaultODataPathHandler(), ODataRoutingConventions.CreateDefault()); diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/Extensibility/SerializeEntityReferenceLinks.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/Extensibility/SerializeEntityReferenceLinks.cs index 88fc2fd8b5..c3108a83f7 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/Extensibility/SerializeEntityReferenceLinks.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/Extensibility/SerializeEntityReferenceLinks.cs @@ -190,14 +190,14 @@ public override string SelectAction(ODataPath odataPath, HttpControllerContext c } } - public class SerializeEntityReferenceLinksTest : WebHostTestBase + public class SerializeEntityReferenceLinksTest : WebHostTestBase { - public SerializeEntityReferenceLinksTest(WebHostTestFixture fixture) + public SerializeEntityReferenceLinksTest(WebHostTestFixture fixture) :base(fixture) { } - protected override void UpdateConfiguration(WebRouteConfiguration configuration) + protected static void UpdateConfigure(WebRouteConfiguration configuration) { var routingConventions = ODataRoutingConventions.CreateDefault(); routingConventions.Insert(4, new GetRefRoutingConvention()); diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/Extensibility/SupportDollarValue.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/Extensibility/SupportDollarValue.cs index 5c8f877e80..60de8f2275 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/Extensibility/SupportDollarValue.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/Extensibility/SupportDollarValue.cs @@ -66,14 +66,14 @@ public byte[] GetBinaryProperty(int key) } #if !NETCORE // TODO #939: Enable these tests for AspNetCore - public class SupportDollarValueTest : WebHostTestBase + public class SupportDollarValueTest : WebHostTestBase { - public SupportDollarValueTest(WebHostTestFixture fixture) + public SupportDollarValueTest(WebHostTestFixture fixture) :base(fixture) { } - protected override void UpdateConfiguration(WebRouteConfiguration configuration) + protected static void UpdateConfigure(WebRouteConfiguration configuration) { configuration. MapODataServiceRoute( diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/HttpAndODataErrorTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/HttpAndODataErrorTests.cs index cc4c64343f..5756be7e0a 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/HttpAndODataErrorTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/HttpAndODataErrorTests.cs @@ -99,9 +99,9 @@ public HttpError_Item GetItems(int key) } } - public class HttpAndODataErrorAlwaysIncludeDetailsTests : WebHostTestBase + public class HttpAndODataErrorAlwaysIncludeDetailsTests : WebHostTestBase { - public HttpAndODataErrorAlwaysIncludeDetailsTests(WebHostTestFixture fixture) + public HttpAndODataErrorAlwaysIncludeDetailsTests(WebHostTestFixture fixture) :base(fixture) { } @@ -212,7 +212,7 @@ public static HttpRequestMessage CreateRequestMessage(string baseAddress, ErrorT return request; } - protected override void UpdateConfiguration(WebRouteConfiguration configuration) + protected static void UpdateConfigure(WebRouteConfiguration configuration) { configuration.JsonReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Ignore; @@ -250,9 +250,9 @@ public virtual async Task TestHttpErrorInAction(ErrorType errorType, int code, s } } - public class HttpAndODataErrorNeverIncludeDetailsTests : WebHostTestBase + public class HttpAndODataErrorNeverIncludeDetailsTests : WebHostTestBase { - public HttpAndODataErrorNeverIncludeDetailsTests(WebHostTestFixture fixture) + public HttpAndODataErrorNeverIncludeDetailsTests(WebHostTestFixture fixture) :base(fixture) { } @@ -297,7 +297,7 @@ public static TheoryDataSet TestData } } - protected override void UpdateConfiguration(WebRouteConfiguration configuration) + protected static void UpdateConfigure(WebRouteConfiguration configuration) { configuration.IncludeErrorDetail = false; configuration.JsonReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Ignore; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/InheritanceTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/InheritanceTests.cs index dd691eb008..dd032498e1 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/InheritanceTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/InheritanceTests.cs @@ -213,9 +213,9 @@ public IEnumerable GetVehicles(int key) #endregion - public abstract class InheritanceTests : ODataFormatterTestBase + public abstract class InheritanceTests : ODataFormatterTestBase { - public InheritanceTests(WebHostTestFixture fixture) + public InheritanceTests(WebHostTestFixture fixture) :base(fixture) { } diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/JsonLightCollectionPropertyTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/JsonLightCollectionPropertyTests.cs index 73bbfc7490..1b87844b70 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/JsonLightCollectionPropertyTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/JsonLightCollectionPropertyTests.cs @@ -10,9 +10,9 @@ namespace Microsoft.Test.E2E.AspNet.OData.Formatter.JsonLight { - public class JsonLightCollectionPropertyTests : CollectionPropertyTests + public class JsonLightCollectionPropertyTests : CollectionPropertyTests { - public JsonLightCollectionPropertyTests(WebHostTestFixture fixture) + public JsonLightCollectionPropertyTests(WebHostTestFixture fixture) :base(fixture) { } @@ -49,7 +49,7 @@ public async Task SupportPostCollectionPropertyByEntityPayloadJSonLight(string a await SupportPostCollectionPropertyByEntityPayload(); } - protected override void UpdateConfiguration(WebRouteConfiguration configuration) + protected static void UpdateConfigure(WebRouteConfiguration configuration) { configuration.JsonReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Ignore; configuration.RemoveNonODataFormatters(); diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/JsonLightComplexTypeTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/JsonLightComplexTypeTests.cs index e5a55aa982..2476310eee 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/JsonLightComplexTypeTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/JsonLightComplexTypeTests.cs @@ -10,9 +10,9 @@ namespace Microsoft.Test.E2E.AspNet.OData.Formatter.JsonLight { - public class JsonLightComplexTypeTests : ComplexTypeTests + public class JsonLightComplexTypeTests : ComplexTypeTests { - public JsonLightComplexTypeTests(WebHostTestFixture fixture) + public JsonLightComplexTypeTests(WebHostTestFixture fixture) :base(fixture) { } @@ -33,7 +33,7 @@ public override DataServiceContext ReaderClient(Uri serviceRoot, ODataProtocolVe return ctx; } - protected override void UpdateConfiguration(WebRouteConfiguration configuration) + protected static void UpdateConfigure(WebRouteConfiguration configuration) { configuration.JsonReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Ignore; configuration.RemoveNonODataFormatters(); diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/JsonLightDeltaTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/JsonLightDeltaTests.cs index e7949e4137..d0374d7fd2 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/JsonLightDeltaTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/JsonLightDeltaTests.cs @@ -10,9 +10,9 @@ namespace Microsoft.Test.E2E.AspNet.OData.Formatter.JsonLight { - public class JsonLightDeltaTests : DeltaTests + public class JsonLightDeltaTests : DeltaTests { - public JsonLightDeltaTests(WebHostTestFixture fixture) + public JsonLightDeltaTests(WebHostTestFixture fixture) :base(fixture) { } @@ -33,7 +33,7 @@ public override DataServiceContext ReaderClient(Uri serviceRoot, ODataProtocolVe return ctx; } - protected override void UpdateConfiguration(WebRouteConfiguration configuration) + protected static void UpdateConfigure(WebRouteConfiguration configuration) { configuration.JsonReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Ignore; configuration.EnableODataSupport(GetEdmModel(configuration)); diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/JsonLightDeserializationAndSerializationTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/JsonLightDeserializationAndSerializationTests.cs index 83126ebd5c..c0a8ae5d8e 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/JsonLightDeserializationAndSerializationTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/JsonLightDeserializationAndSerializationTests.cs @@ -60,9 +60,9 @@ public UniverseEntityController() } } - public class JsonLightDeserializationAndSerializationTests : ODataFormatterTestBase + public class JsonLightDeserializationAndSerializationTests : ODataFormatterTestBase { - public JsonLightDeserializationAndSerializationTests(WebHostTestFixture fixture) + public JsonLightDeserializationAndSerializationTests(WebHostTestFixture fixture) :base(fixture) { } @@ -138,7 +138,7 @@ public static TheoryDataSet EntityData } } - protected override void UpdateConfiguration(WebRouteConfiguration configuration) + protected static void UpdateConfigure(WebRouteConfiguration configuration) { configuration.JsonReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Ignore; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/JsonLightInheritanceTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/JsonLightInheritanceTests.cs index 6bbd49e461..343534cbfa 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/JsonLightInheritanceTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/JsonLightInheritanceTests.cs @@ -15,9 +15,9 @@ namespace Microsoft.Test.E2E.AspNet.OData.Formatter.JsonLight { - public class JsonLightInheritanceTests : InheritanceTests + public class JsonLightInheritanceTests : InheritanceTests { - public JsonLightInheritanceTests(WebHostTestFixture fixture) + public JsonLightInheritanceTests(WebHostTestFixture fixture) :base(fixture) { } @@ -75,7 +75,7 @@ public override DataServiceContext ReaderClient(Uri serviceRoot, ODataProtocolVe return ctx; } - protected override void UpdateConfiguration(WebRouteConfiguration configuration) + protected static void UpdateConfigure(WebRouteConfiguration configuration) { var conventions = ODataRoutingConventions.CreateDefault(); conventions.Insert(0, new DeleteAllRoutingConvention()); diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/JsonLightMixScenarioTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/JsonLightMixScenarioTests.cs index 22a9cf61bd..7de3e951b7 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/JsonLightMixScenarioTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/JsonLightMixScenarioTests.cs @@ -10,9 +10,9 @@ namespace Microsoft.Test.E2E.AspNet.OData.Formatter.JsonLight { - public class JsonLightMixScenarioTests : MixScenarioTestsOData + public class JsonLightMixScenarioTests : MixScenarioTestsOData { - public JsonLightMixScenarioTests(WebHostTestFixture fixture) + public JsonLightMixScenarioTests(WebHostTestFixture fixture) :base(fixture) { } @@ -33,7 +33,7 @@ public override DataServiceContext ReaderClient(Uri serviceRoot, ODataProtocolVe return ctx; } - protected override void UpdateConfiguration(WebRouteConfiguration configuration) + protected static void UpdateConfigure(WebRouteConfiguration configuration) { configuration.EnableODataSupport(GetEdmModel(configuration), "odata"); } diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/JsonLightRandomModelTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/JsonLightRandomModelTests.cs index b432dcd60b..41cfc508ef 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/JsonLightRandomModelTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/JsonLightRandomModelTests.cs @@ -25,9 +25,9 @@ namespace Microsoft.Test.E2E.AspNet.OData.Formatter.JsonLight { - public class JsonLightRandomModelTests : RandomModelTests + public class JsonLightRandomModelTests : RandomModelTests { - public JsonLightRandomModelTests(WebHostTestFixture fixture) + public JsonLightRandomModelTests(WebHostTestFixture fixture) :base(fixture) { } @@ -86,7 +86,7 @@ public override DataServiceContext ReaderClient(Uri serviceRoot, ODataProtocolVe return ctx; } - protected override void UpdateConfiguration(WebRouteConfiguration configuration) + protected static void UpdateConfigure(WebRouteConfiguration configuration) { configuration.JsonReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Ignore; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/Metadata/ActionMetadataTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/Metadata/ActionMetadataTests.cs index b57871e881..16bcf190c3 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/Metadata/ActionMetadataTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/Metadata/ActionMetadataTests.cs @@ -22,14 +22,14 @@ namespace Microsoft.Test.E2E.AspNet.OData.Formatter.JsonLight.Metadata { - public class ActionMetadataTests : WebHostTestBase + public class ActionMetadataTests : WebHostTestBase { - public ActionMetadataTests(WebHostTestFixture fixture) + public ActionMetadataTests(WebHostTestFixture fixture) :base(fixture) { } - protected override void UpdateConfiguration(WebRouteConfiguration configuration) + protected static void UpdateConfigure(WebRouteConfiguration configuration) { configuration.MapODataServiceRoute("Actions", "Actions", GetActionsModel(configuration), new DefaultODataPathHandler(), ODataRoutingConventions.CreateDefault()); configuration.AddODataQueryFilter(); diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/Metadata/ComplexTypeTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/Metadata/ComplexTypeTests.cs index aa0fa4cf1c..72a66b0b94 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/Metadata/ComplexTypeTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/Metadata/ComplexTypeTests.cs @@ -17,14 +17,14 @@ namespace Microsoft.Test.E2E.AspNet.OData.Formatter.JsonLight.Metadata { - public class ComplexTypeTests : WebHostTestBase + public class ComplexTypeTests : WebHostTestBase { - public ComplexTypeTests(WebHostTestFixture fixture) + public ComplexTypeTests(WebHostTestFixture fixture) :base(fixture) { } - protected override void UpdateConfiguration(WebRouteConfiguration configuration) + protected static void UpdateConfigure(WebRouteConfiguration configuration) { configuration.MapODataServiceRoute("Complex", "Complex", GetEdmModel(configuration), new DefaultODataPathHandler(), ODataRoutingConventions.CreateDefault()); configuration.AddODataQueryFilter(); diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/Metadata/CustomConventionActionMetadataTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/Metadata/CustomConventionActionMetadataTests.cs index 9caef30c7a..95cf96b808 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/Metadata/CustomConventionActionMetadataTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/Metadata/CustomConventionActionMetadataTests.cs @@ -20,14 +20,14 @@ namespace Microsoft.Test.E2E.AspNet.OData.Formatter.JsonLight.Metadata { - public class CustomConventionActionMetadataTests : WebHostTestBase + public class CustomConventionActionMetadataTests : WebHostTestBase { - public CustomConventionActionMetadataTests(WebHostTestFixture fixture) + public CustomConventionActionMetadataTests(WebHostTestFixture fixture) :base(fixture) { } - protected override void UpdateConfiguration(WebRouteConfiguration configuration) + protected static void UpdateConfigure(WebRouteConfiguration configuration) { var conventions = ODataRoutingConventions.CreateDefault(); configuration.MapODataServiceRoute("CustomActionConventions", "CustomActionConventions", GetCustomActionConventionsModel(configuration), new DefaultODataPathHandler(), ODataRoutingConventions.CreateDefault()); diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/Metadata/EntryMetadataTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/Metadata/EntryMetadataTests.cs index bac45f1c17..40b5637292 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/Metadata/EntryMetadataTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/Metadata/EntryMetadataTests.cs @@ -20,14 +20,14 @@ namespace Microsoft.Test.E2E.AspNet.OData.Formatter.JsonLight.Metadata { - public class EntryMetadataTests : WebHostTestBase + public class EntryMetadataTests : WebHostTestBase { - public EntryMetadataTests(WebHostTestFixture fixture) + public EntryMetadataTests(WebHostTestFixture fixture) :base(fixture) { } - protected override void UpdateConfiguration(WebRouteConfiguration configuration) + protected static void UpdateConfigure(WebRouteConfiguration configuration) { configuration.MapODataServiceRoute("Relationships", "Relationships", GetRelationshipsModel(configuration), new DefaultODataPathHandler(), ODataRoutingConventions.CreateDefault()); configuration.MapODataServiceRoute("Inheritance", "Inheritance", GetInheritanceModel(configuration), new DefaultODataPathHandler(), ODataRoutingConventions.CreateDefault()); diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/Metadata/FeedMetadataTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/Metadata/FeedMetadataTests.cs index e7d586c114..ef8edfd183 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/Metadata/FeedMetadataTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/Metadata/FeedMetadataTests.cs @@ -16,14 +16,14 @@ namespace Microsoft.Test.E2E.AspNet.OData.Formatter.JsonLight.Metadata { - public class FeedMetadataTests : WebHostTestBase + public class FeedMetadataTests : WebHostTestBase { - public FeedMetadataTests(WebHostTestFixture fixture) + public FeedMetadataTests(WebHostTestFixture fixture) :base(fixture) { } - protected override void UpdateConfiguration(WebRouteConfiguration configuration) + protected static void UpdateConfigure(WebRouteConfiguration configuration) { configuration.EnableODataSupport(GetEdmModel(configuration)); configuration.AddODataQueryFilter(); diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/Metadata/MinimalMetadataSpecificTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/Metadata/MinimalMetadataSpecificTests.cs index 9a74344c05..15c6b7ae4c 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/Metadata/MinimalMetadataSpecificTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/Metadata/MinimalMetadataSpecificTests.cs @@ -17,14 +17,14 @@ namespace Microsoft.Test.E2E.AspNet.OData.Formatter.JsonLight.Metadata { - public class MinimalMetadataSpecificTests : WebHostTestBase + public class MinimalMetadataSpecificTests : WebHostTestBase { - public MinimalMetadataSpecificTests(WebHostTestFixture fixture) + public MinimalMetadataSpecificTests(WebHostTestFixture fixture) :base(fixture) { } - protected override void UpdateConfiguration(WebRouteConfiguration config) + protected static void UpdateConfigure(WebRouteConfiguration config) { config.Routes.Clear(); config.MapODataServiceRoute("odata", "odata", GetModel(config), new DefaultODataPathHandler(), ODataRoutingConventions.CreateDefault()); diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/Metadata/PrimitiveTypesMetadataTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/Metadata/PrimitiveTypesMetadataTests.cs index ccaf62de0e..1d168f232b 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/Metadata/PrimitiveTypesMetadataTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/Metadata/PrimitiveTypesMetadataTests.cs @@ -21,14 +21,14 @@ namespace Microsoft.Test.E2E.AspNet.OData.Formatter.JsonLight.Metadata { - public class PrimitiveTypesMetadataTests : WebHostTestBase + public class PrimitiveTypesMetadataTests : WebHostTestBase { - public PrimitiveTypesMetadataTests(WebHostTestFixture fixture) + public PrimitiveTypesMetadataTests(WebHostTestFixture fixture) :base(fixture) { } - protected override void UpdateConfiguration(WebRouteConfiguration configuration) + protected static void UpdateConfigure(WebRouteConfiguration configuration) { IList conventions = ODataRoutingConventions.CreateDefault(); conventions.Insert(0, new ReflectedPropertyRoutingConvention()); diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/MixScenarioTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/MixScenarioTests.cs index 3b2314dcd8..19b71c01eb 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/MixScenarioTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/MixScenarioTests.cs @@ -79,14 +79,14 @@ public MixScenarioTests_ODataController() } } - public class MixScenarioTestsWebApi : WebHostTestBase + public class MixScenarioTestsWebApi : WebHostTestBase { - public MixScenarioTestsWebApi(WebHostTestFixture fixture) + public MixScenarioTestsWebApi(WebHostTestFixture fixture) :base(fixture) { } - protected override void UpdateConfiguration(WebRouteConfiguration configuration) + protected static void UpdateConfigure(WebRouteConfiguration configuration) { configuration.EnableODataSupport(GetEdmModel(configuration), "odata"); configuration.Count().Filter().OrderBy().Expand().MaxTop(null); @@ -129,9 +129,9 @@ public async Task WebAPIQueryableShouldWork() } } - public abstract class MixScenarioTestsOData : ODataFormatterTestBase + public abstract class MixScenarioTestsOData : ODataFormatterTestBase { - public MixScenarioTestsOData(WebHostTestFixture fixture) + public MixScenarioTestsOData(WebHostTestFixture fixture) :base(fixture) { } diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/ODataFeedSerializeWithoutNavigationSourceTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/ODataFeedSerializeWithoutNavigationSourceTests.cs index 01534d62fb..acee4e6207 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/ODataFeedSerializeWithoutNavigationSourceTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/ODataFeedSerializeWithoutNavigationSourceTests.cs @@ -19,14 +19,14 @@ namespace Microsoft.Test.E2E.AspNet.OData.Formatter { - public class ODataFeedSerializeWithoutNavigationSourceTests : WebHostTestBase + public class ODataFeedSerializeWithoutNavigationSourceTests : WebHostTestBase { - public ODataFeedSerializeWithoutNavigationSourceTests(WebHostTestFixture fixture) + public ODataFeedSerializeWithoutNavigationSourceTests(WebHostTestFixture fixture) :base(fixture) { } - protected override void UpdateConfiguration(WebRouteConfiguration config) + protected static void UpdateConfigure(WebRouteConfiguration config) { var controllers = new[] { typeof(AnyController), typeof(MetadataController) }; config.AddControllers(controllers); diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/ODataFormatterTestBase.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/ODataFormatterTestBase.cs index c2d886895a..e97a310f8f 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/ODataFormatterTestBase.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/ODataFormatterTestBase.cs @@ -13,9 +13,9 @@ public interface IODataFormatterTestBase DataServiceContext WriterClient(Uri serviceRoot, ODataProtocolVersion protocolVersion); } - public abstract class ODataFormatterTestBase : WebHostTestBase, IODataFormatterTestBase + public abstract class ODataFormatterTestBase : WebHostTestBase, IODataFormatterTestBase { - public ODataFormatterTestBase(WebHostTestFixture fixture) + public ODataFormatterTestBase(WebHostTestFixture fixture) :base(fixture) { } diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/ODataResultTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/ODataResultTests.cs index 6180463ec1..963b51ac89 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/ODataResultTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/ODataResultTests.cs @@ -61,22 +61,21 @@ public PageResult GetModel2(ODataQueryOptions options, int k } } - public class ODataResultTests : WebHostTestBase + public class ODataResultTests : WebHostTestBase { - private WebRouteConfiguration _configuration; + private static IEdmModel Model; - public ODataResultTests(WebHostTestFixture fixture) + public ODataResultTests(WebHostTestFixture fixture) :base(fixture) { } - protected override void UpdateConfiguration(WebRouteConfiguration configuration) + protected static void UpdateConfigure(WebRouteConfiguration configuration) { - _configuration = configuration; - configuration.JsonReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Ignore; - configuration.EnableODataSupport(GetEdmModel(configuration)); + Model = GetEdmModel(configuration); + configuration.EnableODataSupport(Model); } private static IEdmModel GetEdmModel(WebRouteConfiguration configuration) @@ -93,7 +92,7 @@ public async Task ODataResultWithZeroResultShouldWork() { // Arrange var ctx = new DataServiceContext(new Uri(this.BaseAddress), ODataProtocolVersion.V4); - ctx.Format.UseJson(GetEdmModel(_configuration)); + ctx.Format.UseJson(Model); ctx.AddObject( "ODataResult_Model1", diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/RandomModelTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/RandomModelTests.cs index e24a095954..24a1d338a4 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/RandomModelTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/RandomModelTests.cs @@ -16,11 +16,11 @@ namespace Microsoft.Test.E2E.AspNet.OData.Formatter { - public abstract class RandomModelTests : WebHostTestBase, IODataFormatterTestBase + public abstract class RandomModelTests : WebHostTestBase, IODataFormatterTestBase { private static ODataModelTypeCreator creator = null; - public RandomModelTests(WebHostTestFixture fixture) + public RandomModelTests(WebHostTestFixture fixture) :base(fixture) { } diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/SecurityTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/SecurityTests.cs index 56c78f28b0..b0e465f421 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/SecurityTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/SecurityTests.cs @@ -69,14 +69,14 @@ public Security_ArrayModelController() } } - public class DosSecurityTests : WebHostTestBase + public class DosSecurityTests : WebHostTestBase { - public DosSecurityTests(WebHostTestFixture fixture) + public DosSecurityTests(WebHostTestFixture fixture) :base(fixture) { } - protected override void UpdateConfiguration(WebRouteConfiguration configuration) + protected static void UpdateConfigure(WebRouteConfiguration configuration) { configuration.MaxReceivedMessageSize = int.MaxValue; configuration.RemoveNonODataFormatters(); diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/ServerDrivenPagingTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/ServerDrivenPagingTests.cs index 8dd3727868..52665c4ba3 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/ServerDrivenPagingTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/ServerDrivenPagingTests.cs @@ -37,14 +37,14 @@ public ServerDrivenPaging_ProductsController() } } - public class ServerDrivenPagingTests : WebHostTestBase + public class ServerDrivenPagingTests : WebHostTestBase { - public ServerDrivenPagingTests(WebHostTestFixture fixture) + public ServerDrivenPagingTests(WebHostTestFixture fixture) :base(fixture) { } - protected override void UpdateConfiguration(WebRouteConfiguration configuration) + protected static void UpdateConfigure(WebRouteConfiguration configuration) { configuration.RemoveNonODataFormatters(); configuration.EnableODataSupport(GetEdmModel(configuration)); diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/SupportMediaTypesTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/SupportMediaTypesTests.cs index ebb8f97d12..23dc61a25d 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/SupportMediaTypesTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/SupportMediaTypesTests.cs @@ -22,14 +22,14 @@ public JsonLight_BlogPostsController() } } - public class SupportMediaTypeTests : WebHostTestBase + public class SupportMediaTypeTests : WebHostTestBase { - public SupportMediaTypeTests(WebHostTestFixture fixture) + public SupportMediaTypeTests(WebHostTestFixture fixture) :base(fixture) { } - protected override void UpdateConfiguration(WebRouteConfiguration configuration) + protected static void UpdateConfigure(WebRouteConfiguration configuration) { configuration.JsonReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Ignore; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/Untyped/UntypedDeltaSerializationTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/Untyped/UntypedDeltaSerializationTests.cs index d500345999..31161824f3 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/Untyped/UntypedDeltaSerializationTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/Untyped/UntypedDeltaSerializationTests.cs @@ -20,14 +20,14 @@ namespace Microsoft.Test.E2E.AspNet.OData.Formatter.Untyped { - public class UntypedDeltaSerializationTests : WebHostTestBase + public class UntypedDeltaSerializationTests : WebHostTestBase { - public UntypedDeltaSerializationTests(WebHostTestFixture fixture) + public UntypedDeltaSerializationTests(WebHostTestFixture fixture) :base(fixture) { } - protected override void UpdateConfiguration(WebRouteConfiguration configuration) + protected static void UpdateConfigure(WebRouteConfiguration configuration) { configuration.JsonReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Ignore; configuration.MapODataServiceRoute("untyped", "untyped", GetEdmModel(configuration), new DefaultODataPathHandler(), ODataRoutingConventions.CreateDefault()); diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/Untyped/UntypedSerializationTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/Untyped/UntypedSerializationTests.cs index 24b1d69721..cb9a12a1bb 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/Untyped/UntypedSerializationTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/Untyped/UntypedSerializationTests.cs @@ -25,14 +25,14 @@ namespace Microsoft.Test.E2E.AspNet.OData.Formatter.Untyped { - public class UntypedSerializationTests : WebHostTestBase + public class UntypedSerializationTests : WebHostTestBase { - public UntypedSerializationTests(WebHostTestFixture fixture) + public UntypedSerializationTests(WebHostTestFixture fixture) :base(fixture) { } - protected override void UpdateConfiguration(WebRouteConfiguration configuration) + protected static void UpdateConfigure(WebRouteConfiguration configuration) { configuration.JsonReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Ignore; configuration.Count().Filter().OrderBy().Expand().MaxTop(null).Select(); diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/LowerCamelCase/LowerCamelCaseTest.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/LowerCamelCase/LowerCamelCaseTest.cs index 076b156e73..a317c36511 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/LowerCamelCase/LowerCamelCaseTest.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/LowerCamelCase/LowerCamelCaseTest.cs @@ -19,14 +19,14 @@ namespace Microsoft.Test.E2E.AspNet.OData.LowerCamelCase { - public class LowerCamelCaseTest : WebHostTestBase + public class LowerCamelCaseTest : WebHostTestBase { - public LowerCamelCaseTest(WebHostTestFixture fixture) + public LowerCamelCaseTest(WebHostTestFixture fixture) :base(fixture) { } - protected override void UpdateConfiguration(WebRouteConfiguration configuration) + protected static void UpdateConfigure(WebRouteConfiguration configuration) { var controllers = new[] { typeof(EmployeesController), typeof(MetadataController) }; configuration.AddControllers(controllers); diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelAliasing/FormattersTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelAliasing/FormattersTests.cs index 66a4ae79f9..21a95b876e 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelAliasing/FormattersTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelAliasing/FormattersTests.cs @@ -21,14 +21,14 @@ namespace Microsoft.Test.E2E.AspNet.OData.ModelAliasing { - public class FormattersTests : WebHostTestBase + public class FormattersTests : WebHostTestBase { - public FormattersTests(WebHostTestFixture fixture) + public FormattersTests(WebHostTestFixture fixture) :base(fixture) { } - protected override void UpdateConfiguration(WebRouteConfiguration config) + protected static void UpdateConfigure(WebRouteConfiguration config) { config.Routes.Clear(); config.Count().Filter().OrderBy().Expand().MaxTop(null).Select(); diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelAliasing/MetadataTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelAliasing/MetadataTests.cs index ce1be629c9..8c738313e3 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelAliasing/MetadataTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelAliasing/MetadataTests.cs @@ -15,14 +15,14 @@ namespace Microsoft.Test.E2E.AspNet.OData.ModelAliasing { - public class ModelBuildersMetadataTests : WebHostTestBase + public class ModelBuildersMetadataTests : WebHostTestBase { - public ModelBuildersMetadataTests(WebHostTestFixture fixture) + public ModelBuildersMetadataTests(WebHostTestFixture fixture) :base(fixture) { } - protected override void UpdateConfiguration(WebRouteConfiguration config) + protected static void UpdateConfigure(WebRouteConfiguration config) { config.Routes.Clear(); config.MapODataServiceRoute("convention", "convention", GetConventionModel(config), new DefaultODataPathHandler(), ODataRoutingConventions.CreateDefault()); diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelAliasing/QueryTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelAliasing/QueryTests.cs index 5148216495..3a76676be6 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelAliasing/QueryTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelAliasing/QueryTests.cs @@ -21,14 +21,14 @@ namespace Microsoft.Test.E2E.AspNet.OData.ModelAliasing { - public class QueryTests : WebHostTestBase + public class QueryTests : WebHostTestBase { - public QueryTests(WebHostTestFixture fixture) + public QueryTests(WebHostTestFixture fixture) :base(fixture) { } - protected override void UpdateConfiguration(WebRouteConfiguration configuration) + protected static void UpdateConfigure(WebRouteConfiguration configuration) { configuration.Count().Filter().OrderBy().Expand().MaxTop(null).Select(); configuration.MapODataServiceRoute("convention", "convention", GetConventionModel(configuration), new DefaultODataPathHandler(), ODataRoutingConventions.CreateDefault()); diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBoundQuerySettings/CombinedTest/CombinedTest.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBoundQuerySettings/CombinedTest/CombinedTest.cs index dbd92a7b0a..74287545ab 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBoundQuerySettings/CombinedTest/CombinedTest.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBoundQuerySettings/CombinedTest/CombinedTest.cs @@ -11,19 +11,19 @@ namespace Microsoft.Test.E2E.AspNet.OData.ModelBoundQuerySettings.CombinedTest { - public class CombinedTest : WebHostTestBase + public class CombinedTest : WebHostTestBase { private const string CustomerBaseUrl = "{0}/enablequery/Customers"; private const string OrderBaseUrl = "{0}/enablequery/Orders"; private const string ModelBoundCustomerBaseUrl = "{0}/modelboundapi/Customers"; private const string ModelBoundOrderBaseUrl = "{0}/modelboundapi/Orders"; - public CombinedTest(WebHostTestFixture fixture) + public CombinedTest(WebHostTestFixture fixture) :base(fixture) { } - protected override void UpdateConfiguration(WebRouteConfiguration configuration) + protected static void UpdateConfigure(WebRouteConfiguration configuration) { configuration.AddControllers(typeof(CustomersController), typeof(OrdersController)); configuration.JsonReferenceLoopHandling = @@ -66,11 +66,11 @@ public async Task DefaultQuerySettings(string url, string error) [InlineData(CustomerBaseUrl, "Orders($count=true)", "count")] [InlineData(CustomerBaseUrl, "Orders($filter=Id eq 1)", "filter")] [InlineData(CustomerBaseUrl, "Orders($orderby=Id)", "orderby")] - [InlineData(CustomerBaseUrl, "Orders($top=3)", "top")] + [InlineData(CustomerBaseUrl, "Orders($top=13)", "top")] [InlineData(ModelBoundCustomerBaseUrl, "Orders($count=true)", "count")] [InlineData(ModelBoundCustomerBaseUrl, "Orders($filter=Id eq 1)", "filter")] [InlineData(ModelBoundCustomerBaseUrl, "Orders($orderby=Id)", "orderby")] - [InlineData(ModelBoundCustomerBaseUrl, "Orders($top=3)", "top")] + [InlineData(ModelBoundCustomerBaseUrl, "Orders($top=23)", "top")] public async Task QueryAttributeOnEntityTypeNegative(string entitySetUrl, string expandOption, string error) { string queryUrl = @@ -112,9 +112,9 @@ public async Task QueryAttributeOnEntityTypePositive(string entitySetUrl, string [Theory] [InlineData(CustomerBaseUrl, "?$expand=Orders($expand=Customers($count=true))", "count")] - [InlineData(OrderBaseUrl, "?$expand=Customers2($expand=Order($top=3))", "top")] + [InlineData(OrderBaseUrl, "?$expand=Customers2($expand=Order($top=33))", "top")] [InlineData(ModelBoundCustomerBaseUrl, "?$expand=Orders($expand=Customers($count=true))", "count")] - [InlineData(ModelBoundOrderBaseUrl, "?$expand=Customers2($expand=Order($top=3))", "top")] + [InlineData(ModelBoundOrderBaseUrl, "?$expand=Customers2($expand=Order($top=43))", "top")] public async Task QuerySettingsOnPropertyNegative(string entitySetUrl, string url, string error) { string queryUrl = diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBoundQuerySettings/CountAttributeTest/CountAttributeTest.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBoundQuerySettings/CountAttributeTest/CountAttributeTest.cs index 9e35f4fc15..4530d7a5a7 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBoundQuerySettings/CountAttributeTest/CountAttributeTest.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBoundQuerySettings/CountAttributeTest/CountAttributeTest.cs @@ -11,19 +11,19 @@ namespace Microsoft.Test.E2E.AspNet.OData.ModelBoundQuerySettings.CountAttributeTest { - public class CountAttributeTest : WebHostTestBase + public class CountAttributeTest : WebHostTestBase { private const string CustomerBaseUrl = "{0}/enablequery/Customers"; private const string OrderBaseUrl = "{0}/enablequery/Orders"; private const string ModelBoundCustomerBaseUrl = "{0}/modelboundapi/Customers"; private const string ModelBoundOrderBaseUrl = "{0}/modelboundapi/Orders"; - public CountAttributeTest(WebHostTestFixture fixture) + public CountAttributeTest(WebHostTestFixture fixture) :base(fixture) { } - protected override void UpdateConfiguration(WebRouteConfiguration configuration) + protected static void UpdateConfigure(WebRouteConfiguration configuration) { configuration.AddControllers(typeof(CustomersController), typeof(OrdersController)); configuration.JsonReferenceLoopHandling = diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBoundQuerySettings/ExpandAttributeTest/ExpandAttributeTest.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBoundQuerySettings/ExpandAttributeTest/ExpandAttributeTest.cs index 36aa683e28..5bab287fac 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBoundQuerySettings/ExpandAttributeTest/ExpandAttributeTest.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBoundQuerySettings/ExpandAttributeTest/ExpandAttributeTest.cs @@ -11,19 +11,19 @@ namespace Microsoft.Test.E2E.AspNet.OData.ModelBoundQuerySettings.ExpandAttributeTest { - public class ExpandAttributeTest : WebHostTestBase + public class ExpandAttributeTest : WebHostTestBase { private const string CustomerBaseUrl = "{0}/enablequery/Customers"; private const string OrderBaseUrl = "{0}/enablequery/Orders"; private const string ModelBoundCustomerBaseUrl = "{0}/modelboundapi/Customers"; private const string ModelBoundOrderBaseUrl = "{0}/modelboundapi/Orders"; - public ExpandAttributeTest(WebHostTestFixture fixture) + public ExpandAttributeTest(WebHostTestFixture fixture) :base(fixture) { } - protected override void UpdateConfiguration(WebRouteConfiguration configuration) + protected static void UpdateConfigure(WebRouteConfiguration configuration) { configuration.AddControllers(typeof(CustomersController), typeof(OrdersController)); configuration.JsonReferenceLoopHandling = diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBoundQuerySettings/FilterAttributeTest/FilterAttributeTest.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBoundQuerySettings/FilterAttributeTest/FilterAttributeTest.cs index ef83bc027f..7ecce5f746 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBoundQuerySettings/FilterAttributeTest/FilterAttributeTest.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBoundQuerySettings/FilterAttributeTest/FilterAttributeTest.cs @@ -11,7 +11,7 @@ namespace Microsoft.Test.E2E.AspNet.OData.ModelBoundQuerySettings.FilterAttributeTest { - public class FilterAttributeTest : WebHostTestBase + public class FilterAttributeTest : WebHostTestBase { private const string CustomerBaseUrl = "{0}/enablequery/Customers"; private const string OrderBaseUrl = "{0}/enablequery/Orders"; @@ -20,12 +20,12 @@ public class FilterAttributeTest : WebHostTestBase private const string ModelBoundOrderBaseUrl = "{0}/modelboundapi/Orders"; private const string ModelBoundCarBaseUrl = "{0}/modelboundapi/Cars"; - public FilterAttributeTest(WebHostTestFixture fixture) + public FilterAttributeTest(WebHostTestFixture fixture) :base(fixture) { } - protected override void UpdateConfiguration(WebRouteConfiguration configuration) + protected static void UpdateConfigure(WebRouteConfiguration configuration) { configuration.AddControllers(typeof(CustomersController), typeof(OrdersController), typeof(CarsController)); diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBoundQuerySettings/OrderByAttributeTest/OrderByAttributeTest.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBoundQuerySettings/OrderByAttributeTest/OrderByAttributeTest.cs index f823b56b18..aa2176c233 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBoundQuerySettings/OrderByAttributeTest/OrderByAttributeTest.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBoundQuerySettings/OrderByAttributeTest/OrderByAttributeTest.cs @@ -11,7 +11,7 @@ namespace Microsoft.Test.E2E.AspNet.OData.ModelBoundQuerySettings.OrderByAttributeTest { - public class OrderByAttributeTest : WebHostTestBase + public class OrderByAttributeTest : WebHostTestBase { private const string CustomerBaseUrl = "{0}/enablequery/Customers"; private const string OrderBaseUrl = "{0}/enablequery/Orders"; @@ -20,12 +20,12 @@ public class OrderByAttributeTest : WebHostTestBase private const string ModelBoundOrderBaseUrl = "{0}/modelboundapi/Orders"; private const string ModelBoundCarBaseUrl = "{0}/modelboundapi/Cars"; - public OrderByAttributeTest(WebHostTestFixture fixture) + public OrderByAttributeTest(WebHostTestFixture fixture) :base(fixture) { } - protected override void UpdateConfiguration(WebRouteConfiguration configuration) + protected static void UpdateConfigure(WebRouteConfiguration configuration) { configuration.AddControllers(typeof(CustomersController), typeof(OrdersController), typeof(CarsController)); diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBoundQuerySettings/PageAttributeTest/PageAttributeTest.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBoundQuerySettings/PageAttributeTest/PageAttributeTest.cs index d377d3f145..7f6f41fdf7 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBoundQuerySettings/PageAttributeTest/PageAttributeTest.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBoundQuerySettings/PageAttributeTest/PageAttributeTest.cs @@ -12,19 +12,19 @@ namespace Microsoft.Test.E2E.AspNet.OData.ModelBoundQuerySettings.PageAttributeTest { - public class PageAttributeTest : WebHostTestBase + public class PageAttributeTest : WebHostTestBase { private const string CustomerBaseUrl = "{0}/enablequery/Customers"; private const string OrderBaseUrl = "{0}/enablequery/Orders"; private const string ModelBoundCustomerBaseUrl = "{0}/modelboundapi/Customers"; private const string ModelBoundOrderBaseUrl = "{0}/modelboundapi/Orders"; - public PageAttributeTest(WebHostTestFixture fixture) + public PageAttributeTest(WebHostTestFixture fixture) :base(fixture) { } - protected override void UpdateConfiguration(WebRouteConfiguration configuration) + protected static void UpdateConfigure(WebRouteConfiguration configuration) { configuration.AddControllers(typeof(CustomersController), typeof(OrdersController)); configuration.JsonReferenceLoopHandling = diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBoundQuerySettings/PageAttributeTest/SkipTokenTest.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBoundQuerySettings/PageAttributeTest/SkipTokenTest.cs index 7f3ecc286f..85fcb51576 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBoundQuerySettings/PageAttributeTest/SkipTokenTest.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBoundQuerySettings/PageAttributeTest/SkipTokenTest.cs @@ -12,17 +12,16 @@ namespace Microsoft.Test.E2E.AspNet.OData.ModelBoundQuerySettings.PageAttributeTest.SkipTokenTest { - public class SkipTokenTest : WebHostTestBase + public class SkipTokenTest : WebHostTestBase { private const string CustomerBaseUrl = "{0}/skiptokentest/Customers"; - private const string OrderBaseUrl = "{0}/skiptokentest/Orders"; - public SkipTokenTest(WebHostTestFixture fixture) + public SkipTokenTest(WebHostTestFixture fixture) :base(fixture) { } - protected override void UpdateConfiguration(WebRouteConfiguration configuration) + protected static void UpdateConfigure(WebRouteConfiguration configuration) { configuration.AddControllers(typeof(CustomersController), typeof(OrdersController)); configuration.JsonReferenceLoopHandling = diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBoundQuerySettings/SelectAttributeTest/SelectAttributeTest.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBoundQuerySettings/SelectAttributeTest/SelectAttributeTest.cs index 777f01e696..89e7663eb5 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBoundQuerySettings/SelectAttributeTest/SelectAttributeTest.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBoundQuerySettings/SelectAttributeTest/SelectAttributeTest.cs @@ -11,7 +11,7 @@ namespace Microsoft.Test.E2E.AspNet.OData.ModelBoundQuerySettings.SelectAttributeTest { - public class SelectAttributeTest : WebHostTestBase + public class SelectAttributeTest : WebHostTestBase { private const string CustomerBaseUrl = "{0}/enablequery/Customers"; private const string OrderBaseUrl = "{0}/enablequery/Orders"; @@ -22,12 +22,12 @@ public class SelectAttributeTest : WebHostTestBase private const string ModelBoundCarBaseUrl = "{0}/modelboundapi/Cars"; private const string ModelBoundAutoSelectCustomerBaseUrl = "{0}/modelboundapi/AutoSelectCustomers"; - public SelectAttributeTest(WebHostTestFixture fixture) + public SelectAttributeTest(WebHostTestFixture fixture) :base(fixture) { } - protected override void UpdateConfiguration(WebRouteConfiguration configuration) + protected static void UpdateConfigure(WebRouteConfiguration configuration) { configuration.AddControllers(typeof(CustomersController), typeof(OrdersController), typeof(CarsController), typeof(AutoSelectCustomersController)); diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBuilder/ActionMetadataTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBuilder/ActionMetadataTests.cs index 597a9fd154..7505965692 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBuilder/ActionMetadataTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBuilder/ActionMetadataTests.cs @@ -16,14 +16,14 @@ namespace Microsoft.Test.E2E.AspNet.OData.ModelBuilder { - public class ActionMetadataTests : WebHostTestBase + public class ActionMetadataTests : WebHostTestBase { - public ActionMetadataTests(WebHostTestFixture fixture) + public ActionMetadataTests(WebHostTestFixture fixture) :base(fixture) { } - protected override void UpdateConfiguration(WebRouteConfiguration config) + protected static void UpdateConfigure(WebRouteConfiguration config) { config.Routes.Clear(); config.MapODataServiceRoute("odata", "odata", GetModel(config), new DefaultODataPathHandler(), ODataRoutingConventions.CreateDefault()); diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBuilder/AttributeConventionModelBuilderTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBuilder/AttributeConventionModelBuilderTests.cs index 6eb15b543e..9a4e9841ff 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBuilder/AttributeConventionModelBuilderTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBuilder/AttributeConventionModelBuilderTests.cs @@ -6,8 +6,8 @@ using System.ComponentModel.DataAnnotations.Schema; using System.Linq; using System.Runtime.Serialization; +using Microsoft.AspNet.OData.Builder; using Microsoft.OData.Edm; -using Microsoft.Test.E2E.AspNet.OData.Common.Execution; using Xunit; namespace Microsoft.Test.E2E.AspNet.OData.ModelBuilder @@ -64,24 +64,15 @@ public class IgnoreMemberModel public string IgnoreProperty2 { get; set; } } - public class AttributeConventionModelBuilderTests : WebHostTestBase + /// + /// This test class doesn't rely on any Web host, so don't derive from WebHostTestBase{Test} + /// + public class AttributeConventionModelBuilderTests { - WebRouteConfiguration _configuration; - - public AttributeConventionModelBuilderTests(WebHostTestFixture fixture) - :base(fixture) - { - } - - protected override void UpdateConfiguration(WebRouteConfiguration configuration) - { - _configuration = configuration; - } - [Fact] public void TestSimpleDataContractModel() { - var builder = _configuration.CreateConventionModelBuilder(); + var builder = new ODataConventionModelBuilder(); builder.EntitySet("SimpleDataContractModels"); var model = builder.GetEdmModel(); diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBuilder/ConditionalLinkGenerationTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBuilder/ConditionalLinkGenerationTests.cs index ef6447480f..956f390375 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBuilder/ConditionalLinkGenerationTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBuilder/ConditionalLinkGenerationTests.cs @@ -64,19 +64,19 @@ public ConditionalLinkGeneration_ProductFamiliesController() } } - public class ConditionalLinkGeneration_ConventionModelBuilder_Tests : WebHostTestBase + public class ConditionalLinkGeneration_ConventionModelBuilder_Tests : WebHostTestBase { - public ConditionalLinkGeneration_ConventionModelBuilder_Tests(WebHostTestFixture fixture) + public ConditionalLinkGeneration_ConventionModelBuilder_Tests(WebHostTestFixture fixture) :base(fixture) { } - protected override void UpdateConfiguration(WebRouteConfiguration configuration) + protected static void UpdateConfigure(WebRouteConfiguration configuration) { configuration.EnableODataSupport(GetImplicitEdmModel(configuration)); } - private static Microsoft.OData.Edm.IEdmModel GetImplicitEdmModel(WebRouteConfiguration configuration) + private static IEdmModel GetImplicitEdmModel(WebRouteConfiguration configuration) { ODataConventionModelBuilder modelBuilder = configuration.CreateConventionModelBuilder(); var products = modelBuilder.EntitySet("ConditionalLinkGeneration_Products"); diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBuilder/ExplicitModelBuilderTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBuilder/ExplicitModelBuilderTests.cs index 863eadd86d..4973a2a03c 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBuilder/ExplicitModelBuilderTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBuilder/ExplicitModelBuilderTests.cs @@ -18,14 +18,14 @@ namespace Microsoft.Test.E2E.AspNet.OData.ModelBuilder { - public class ExplicitModelBuilderTests : WebHostTestBase + public class ExplicitModelBuilderTests : WebHostTestBase { - public ExplicitModelBuilderTests(WebHostTestFixture fixture) + public ExplicitModelBuilderTests(WebHostTestFixture fixture) :base(fixture) { } - protected override void UpdateConfiguration(WebRouteConfiguration configuration) + protected static void UpdateConfigure(WebRouteConfiguration configuration) { configuration.JsonReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Ignore; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBuilder/ImplicitModelBuilderTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBuilder/ImplicitModelBuilderTests.cs index 890139807f..766ec17655 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBuilder/ImplicitModelBuilderTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBuilder/ImplicitModelBuilderTests.cs @@ -64,17 +64,11 @@ public class ImplicitModelBuilder_EntityWithStaticProperty public static string StaticProperty { get; set; } } - public class ImplicitModelBuilderTests : WebHostTestBase + /// + /// This test class doesn't rely on any Web host, so don't derive from WebHostTestBase{Test} + /// + public class ImplicitModelBuilderTests { - public ImplicitModelBuilderTests(WebHostTestFixture fixture) - :base(fixture) - { - } - - protected override void UpdateConfiguration(WebRouteConfiguration configuration) - { - } - [Fact] public void ShouldIgnoreStaticProperty() { @@ -172,14 +166,14 @@ public void MultiplicityAssociationShouldWork() } } - public class ImplicitModelBuilderE2ETests : WebHostTestBase + public class ImplicitModelBuilderE2ETests : WebHostTestBase { - public ImplicitModelBuilderE2ETests(WebHostTestFixture fixture) + public ImplicitModelBuilderE2ETests(WebHostTestFixture fixture) :base(fixture) { } - protected override void UpdateConfiguration(WebRouteConfiguration configuration) + protected static void UpdateConfigure(WebRouteConfiguration configuration) { configuration.JsonReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Ignore; configuration.EnableODataSupport(GetImplicitEdmModel(configuration)); diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBuilder/InheritanceTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBuilder/InheritanceTests.cs index 7a0d876ee4..0c76befb33 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBuilder/InheritanceTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBuilder/InheritanceTests.cs @@ -5,7 +5,6 @@ using System.Linq; using Microsoft.AspNet.OData.Builder; using Microsoft.OData.Edm; -using Microsoft.Test.E2E.AspNet.OData.Common.Execution; using Xunit; namespace Microsoft.Test.E2E.AspNet.OData.ModelBuilder @@ -22,24 +21,15 @@ public class InheritanceTests_Manager : InheritanceTests_Employee public List DirectReports { get; set; } } - public class InheritanceTests : WebHostTestBase + /// + /// This test class doesn't rely on any Web host, so don't derive from WebHostTestBase{Test} + /// + public class InheritanceTests { - private WebRouteConfiguration _configuration; - - public InheritanceTests(WebHostTestFixture fixture) - :base(fixture) - { - } - - protected override void UpdateConfiguration(WebRouteConfiguration configuration) - { - _configuration = configuration; - } - [Fact] public void IgnoredBaseTypePropertyShouldBeIgnoredInDeriveTypeAsWell() { - ODataConventionModelBuilder builder = _configuration.CreateConventionModelBuilder(); + ODataConventionModelBuilder builder = new ODataConventionModelBuilder(); var employees = builder.EntitySet("InheritanceTests_Employee"); employees.EntityType.Ignore(e => e.Photo); var model = builder.GetEdmModel(); diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBuilder/MultipleEntitySetOnSameClrTypeTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBuilder/MultipleEntitySetOnSameClrTypeTests.cs index 0d8681f567..9b60e4ac04 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBuilder/MultipleEntitySetOnSameClrTypeTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBuilder/MultipleEntitySetOnSameClrTypeTests.cs @@ -52,14 +52,14 @@ public MultipleEntitySetOnSameClrType_Products2Controller() } } - public class MultipleEntitySetOnSameClrTypeTests : WebHostTestBase + public class MultipleEntitySetOnSameClrTypeTests : WebHostTestBase { - public MultipleEntitySetOnSameClrTypeTests(WebHostTestFixture fixture) + public MultipleEntitySetOnSameClrTypeTests(WebHostTestFixture fixture) : base(fixture) { } - protected override void UpdateConfiguration(WebRouteConfiguration configuration) + protected static void UpdateConfigure(WebRouteConfiguration configuration) { configuration.JsonReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Ignore; configuration.Count().Filter().OrderBy().Expand().MaxTop(null).Select(); diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBuilder/ODataActionTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBuilder/ODataActionTests.cs index 9b991a5121..33d6716034 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBuilder/ODataActionTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBuilder/ODataActionTests.cs @@ -35,14 +35,14 @@ namespace Microsoft.Test.E2E.AspNet.OData.ModelBuilder { - public class ODataActionTests : WebHostTestBase + public class ODataActionTests : WebHostTestBase { - public ODataActionTests(WebHostTestFixture fixture) + public ODataActionTests(WebHostTestFixture fixture) :base(fixture) { } - protected override void UpdateConfiguration(WebRouteConfiguration configuration) + protected static void UpdateConfigure(WebRouteConfiguration configuration) { configuration.JsonReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Ignore; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBuilder/PropertyTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBuilder/PropertyTests.cs index 57be070c8e..5296d5958a 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBuilder/PropertyTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBuilder/PropertyTests.cs @@ -35,14 +35,14 @@ namespace Microsoft.Test.E2E.AspNet.OData.ModelBuilder { - public class PropertyTestsUsingConventionModelBuilder : WebHostTestBase + public class PropertyTestsUsingConventionModelBuilder : WebHostTestBase { - public PropertyTestsUsingConventionModelBuilder(WebHostTestFixture fixture) + public PropertyTestsUsingConventionModelBuilder(WebHostTestFixture fixture) :base(fixture) { } - protected override void UpdateConfiguration(WebRouteConfiguration config) + protected static void UpdateConfigure(WebRouteConfiguration config) { config.Routes.Clear(); config.MapODataServiceRoute("odata", "odata", GetModel(config), new DefaultODataPathHandler(), ODataRoutingConventions.CreateDefault()); @@ -70,14 +70,14 @@ public async Task ConventionModelBuilderIgnoresPropertyWhenTold() } } - public class PropertyTestsUsingODataModelBuilder : WebHostTestBase + public class PropertyTestsUsingODataModelBuilder : WebHostTestBase { - public PropertyTestsUsingODataModelBuilder(WebHostTestFixture fixture) + public PropertyTestsUsingODataModelBuilder(WebHostTestFixture fixture) :base(fixture) { } - protected override void UpdateConfiguration(WebRouteConfiguration config) + protected static void UpdateConfigure(WebRouteConfiguration config) { config.Routes.Clear(); config.MapODataServiceRoute("odata", "odata", GetModel(), new DefaultODataPathHandler(), ODataRoutingConventions.CreateDefault()); diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBuilder/RecursiveComplexTypesE2ETests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBuilder/RecursiveComplexTypesE2ETests.cs index cc14719e1f..aa16bf1827 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBuilder/RecursiveComplexTypesE2ETests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBuilder/RecursiveComplexTypesE2ETests.cs @@ -18,14 +18,14 @@ namespace Microsoft.Test.E2E.AspNet.OData.ModelBuilder { - public class RecursiveComplexTypesE2ETests : WebHostTestBase + public class RecursiveComplexTypesE2ETests : WebHostTestBase { - public RecursiveComplexTypesE2ETests(WebHostTestFixture fixture) + public RecursiveComplexTypesE2ETests(WebHostTestFixture fixture) : base(fixture) { } - protected override void UpdateConfiguration(WebRouteConfiguration configuration) + protected static void UpdateConfigure(WebRouteConfiguration configuration) { configuration.AddControllers(typeof(UsersController)); configuration.MapODataServiceRoute("recursive", "recursive", GetEdmModel(configuration)); diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBuilder/SpecialCharactersLinkGenerationTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBuilder/SpecialCharactersLinkGenerationTests.cs index 2134cc7856..708cd61a89 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBuilder/SpecialCharactersLinkGenerationTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBuilder/SpecialCharactersLinkGenerationTests.cs @@ -103,20 +103,20 @@ protected SpecialCharactersLinkGenerationTestsModel PatchEntity(string key, Delt } } - public class SpecialCharactersLinkGenerationTests : WebHostTestBase + public class SpecialCharactersLinkGenerationTests : WebHostTestBase { - private IEdmModel _model; + private static IEdmModel Model; - public SpecialCharactersLinkGenerationTests(WebHostTestFixture fixture) + public SpecialCharactersLinkGenerationTests(WebHostTestFixture fixture) :base(fixture) { } - protected override void UpdateConfiguration(WebRouteConfiguration configuration) + protected static void UpdateConfigure(WebRouteConfiguration configuration) { configuration.JsonReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Ignore; - _model = GetEdmModel(configuration); - configuration.EnableODataSupport(_model); + Model = GetEdmModel(configuration); + configuration.EnableODataSupport(Model); } public static IEdmModel GetEdmModel(WebRouteConfiguration configuration) @@ -131,7 +131,7 @@ public static IEdmModel GetEdmModel(WebRouteConfiguration configuration) public async Task TestSpecialCharactersInPrimaryKey() { var context = new DataServiceContext(new Uri(this.BaseAddress)); - context.Format.UseJson(_model); + context.Format.UseJson(Model); var query = context.CreateQuery("SpecialCharactersLinkGenerationTests"); var todoes = await query.ExecuteAsync(); @@ -158,20 +158,20 @@ public async Task TestSpecialCharactersInPrimaryKey() } } - public class SpecialCharactersLinkGenerationWebTests : WebHostTestBase + public class SpecialCharactersLinkGenerationWebTests : WebHostTestBase { - private IEdmModel _model; + private static IEdmModel Model; - public SpecialCharactersLinkGenerationWebTests(WebHostTestFixture fixture) + public SpecialCharactersLinkGenerationWebTests(WebHostTestFixture fixture) :base(fixture) { } - protected override void UpdateConfiguration(WebRouteConfiguration configuration) + protected static void UpdateConfigure(WebRouteConfiguration configuration) { configuration.JsonReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Ignore; - _model = GetEdmModel(configuration); - configuration.EnableODataSupport(_model); + Model = GetEdmModel(configuration); + configuration.EnableODataSupport(Model); } public static IEdmModel GetEdmModel(WebRouteConfiguration configuration) @@ -185,7 +185,7 @@ public static IEdmModel GetEdmModel(WebRouteConfiguration configuration) public async Task TestSpecialCharactersInPrimaryKey() { var client = new DataServiceContext(new Uri(this.BaseAddress)); - client.Format.UseJson(_model); + client.Format.UseJson(Model); var query = client.CreateQuery("SpecialCharactersLinkGenerationWebTests"); var todoes = await query.ExecuteAsync(); diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBuilder/SpecialPrimaryKeyTypesInLinkGenerationTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBuilder/SpecialPrimaryKeyTypesInLinkGenerationTests.cs index d2dd2d706b..35c395b8c8 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBuilder/SpecialPrimaryKeyTypesInLinkGenerationTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBuilder/SpecialPrimaryKeyTypesInLinkGenerationTests.cs @@ -202,14 +202,14 @@ public LongPrimaryKeyType Patch([FromODataUri]long key, LongPrimaryKeyType model } #endregion - public class SpecialPrimaryKeyTypesInLinkGenerationTests : WebHostTestBase + public class SpecialPrimaryKeyTypesInLinkGenerationTests : WebHostTestBase { - public SpecialPrimaryKeyTypesInLinkGenerationTests(WebHostTestFixture fixture) + public SpecialPrimaryKeyTypesInLinkGenerationTests(WebHostTestFixture fixture) :base(fixture) { } - protected override void UpdateConfiguration(WebRouteConfiguration configuration) + protected static void UpdateConfigure(WebRouteConfiguration configuration) { configuration.JsonReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Ignore; var builder = configuration.CreateConventionModelBuilder(); diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBuilder/UnicodeLinkGenerationTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBuilder/UnicodeLinkGenerationTests.cs index 91bd54cc9e..8625c1cd05 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBuilder/UnicodeLinkGenerationTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBuilder/UnicodeLinkGenerationTests.cs @@ -18,14 +18,14 @@ public UnicodeLinkGeneration_Products() } } - public class UnicodeLinkGenerationTests : WebHostTestBase + public class UnicodeLinkGenerationTests : WebHostTestBase { - public UnicodeLinkGenerationTests(WebHostTestFixture fixture) + public UnicodeLinkGenerationTests(WebHostTestFixture fixture) :base(fixture) { } - protected override void UpdateConfiguration(WebRouteConfiguration configuration) + protected static void UpdateConfigure(WebRouteConfiguration configuration) { configuration.JsonReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Ignore; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/NavigationPropertyOnComplexType/NavigationPropertyOnComplexTypeTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/NavigationPropertyOnComplexType/NavigationPropertyOnComplexTypeTests.cs index 77fcfc26dc..5d8f9e83bf 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/NavigationPropertyOnComplexType/NavigationPropertyOnComplexTypeTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/NavigationPropertyOnComplexType/NavigationPropertyOnComplexTypeTests.cs @@ -14,16 +14,16 @@ namespace Microsoft.Test.E2E.AspNet.OData.NavigationPropertyOnComplexType { - public class NavigationPropertyOnComplexType : WebHostTestBase + public class NavigationPropertyOnComplexType : WebHostTestBase { private const string PeopleBaseUrl = "{0}/odata/People"; - public NavigationPropertyOnComplexType(WebHostTestFixture fixture) + public NavigationPropertyOnComplexType(WebHostTestFixture fixture) : base(fixture) { } - protected override void UpdateConfiguration(WebRouteConfiguration configuration) + protected static void UpdateConfigure(WebRouteConfiguration configuration) { configuration.AddControllers(typeof(PeopleController)); configuration.JsonReferenceLoopHandling = diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/NavigationPropertyOnComplexType/SelectImprovementOnComplexTypeTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/NavigationPropertyOnComplexType/SelectImprovementOnComplexTypeTests.cs index e1ae0acc28..e9b714b55d 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/NavigationPropertyOnComplexType/SelectImprovementOnComplexTypeTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/NavigationPropertyOnComplexType/SelectImprovementOnComplexTypeTests.cs @@ -11,16 +11,16 @@ namespace Microsoft.Test.E2E.AspNet.OData.NavigationPropertyOnComplexType { - public class SelectImprovementOnComplexTypeTests : WebHostTestBase + public class SelectImprovementOnComplexTypeTests : WebHostTestBase { private const string PeopleBaseUrl = "{0}/odata/People"; - public SelectImprovementOnComplexTypeTests(WebHostTestFixture fixture) + public SelectImprovementOnComplexTypeTests(WebHostTestFixture fixture) : base(fixture) { } - protected override void UpdateConfiguration(WebRouteConfiguration configuration) + protected static void UpdateConfigure(WebRouteConfiguration configuration) { configuration.AddControllers(typeof(PeopleController)); configuration.JsonReferenceLoopHandling = diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ODataCountTest/CountTest.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ODataCountTest/CountTest.cs index b742153b88..fe0b9582cf 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ODataCountTest/CountTest.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ODataCountTest/CountTest.cs @@ -13,14 +13,14 @@ namespace Microsoft.Test.E2E.AspNet.OData.ODataCountTest { - public class ODataCountTest : WebHostTestBase + public class ODataCountTest : WebHostTestBase { - public ODataCountTest(WebHostTestFixture fixture) + public ODataCountTest(WebHostTestFixture fixture) :base(fixture) { } - protected override void UpdateConfiguration(WebRouteConfiguration configuration) + protected static void UpdateConfigure(WebRouteConfiguration configuration) { var controllers = new[] { typeof(HeroesController) }; configuration.AddControllers(controllers); diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ODataOrderByTest/OrderByTest.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ODataOrderByTest/OrderByTest.cs index 8a9649e944..743ba12f37 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ODataOrderByTest/OrderByTest.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ODataOrderByTest/OrderByTest.cs @@ -13,14 +13,14 @@ namespace Microsoft.Test.E2E.AspNet.OData.ODataOrderByTest { - public class ODataOrderByTest : WebHostTestBase + public class ODataOrderByTest : WebHostTestBase { - public ODataOrderByTest(WebHostTestFixture fixture) + public ODataOrderByTest(WebHostTestFixture fixture) :base(fixture) { } - protected override void UpdateConfiguration(WebRouteConfiguration configuration) + protected static void UpdateConfigure(WebRouteConfiguration configuration) { var controllers = new[] { typeof(ItemsController) }; configuration.AddControllers(controllers); diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ODataPathHandler/LinkGenerationTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ODataPathHandler/LinkGenerationTests.cs index b2bea0102d..03b8b555d1 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ODataPathHandler/LinkGenerationTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ODataPathHandler/LinkGenerationTests.cs @@ -68,14 +68,14 @@ public IQueryable Get() } } - public class LinkGenerationTests : WebHostTestBase + public class LinkGenerationTests : WebHostTestBase { - public LinkGenerationTests(WebHostTestFixture fixture) + public LinkGenerationTests(WebHostTestFixture fixture) :base(fixture) { } - protected override void UpdateConfiguration(WebRouteConfiguration configuration) + protected static void UpdateConfigure(WebRouteConfiguration configuration) { var model1 = GetEdmModel1(configuration); var model2 = GetEdmModel2(configuration); diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ODataPathHandler/UnicodeRouteTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ODataPathHandler/UnicodeRouteTests.cs index c79e8ec32e..37c1bd658b 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ODataPathHandler/UnicodeRouteTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ODataPathHandler/UnicodeRouteTests.cs @@ -36,20 +36,20 @@ public string GetNameü(int key) } } - public class UnicodeRouteTests : WebHostTestBase + public class UnicodeRouteTests : WebHostTestBase { - private WebRouteConfiguration _configuration; + private static IEdmModel Model; - public UnicodeRouteTests(WebHostTestFixture fixture) + public UnicodeRouteTests(WebHostTestFixture fixture) :base(fixture) { } - protected override void UpdateConfiguration(WebRouteConfiguration configuration) + protected static void UpdateConfigure(WebRouteConfiguration configuration) { - _configuration = configuration; configuration.JsonReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Ignore; - configuration.EnableODataSupport(GetEdmModel(configuration), "odataü"); + Model = GetEdmModel(configuration); + configuration.EnableODataSupport(Model, "odataü"); } protected static IEdmModel GetEdmModel(WebRouteConfiguration configuration) @@ -108,7 +108,7 @@ await UpdateEntityAsync(uri, entitySetName, firstVersion, data => private DataServiceContext CreateClient(Uri address) { var client = new DataServiceContext(address, ODataProtocolVersion.V4); - client.Format.UseJson(GetEdmModel(_configuration)); + client.Format.UseJson(Model); return client; } diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/OpenType/TypedTest.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/OpenType/TypedTest.cs index 4d861e99b1..17f9db9839 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/OpenType/TypedTest.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/OpenType/TypedTest.cs @@ -27,31 +27,32 @@ namespace Microsoft.Test.E2E.AspNet.OData.OpenType { - public class TypedOpenTypeTest : WebHostTestBase + public class TypedOpenTypeTest : WebHostTestBase { - WebRouteConfiguration _configuration = null; + private static IEdmModel Model; private static string[] Routings = new string[] { "convention", "AttributeRouting" }; int expectedValueOfInt, actualValueOfInt; int? expectedValueOfNullableInt, actualValueOfNullableInt; string expectedValueOfString, actualValueOfString; - public TypedOpenTypeTest(WebHostTestFixture fixture) + public TypedOpenTypeTest(WebHostTestFixture fixture) :base(fixture) { } - protected override void UpdateConfiguration(WebRouteConfiguration configuration) + protected static void UpdateConfigure(WebRouteConfiguration configuration) { - _configuration = configuration; var controllers = new[] { typeof(EmployeesController), typeof(AccountsController), typeof(MetadataController) }; configuration.AddControllers(controllers); configuration.Routes.Clear(); configuration.Count().Filter().OrderBy().Expand().MaxTop(null).Select(); + + Model = OpenComplexTypeEdmModel.GetTypedConventionModel(configuration); configuration.MapODataServiceRoute( Routings[0], Routings[0], - OpenComplexTypeEdmModel.GetTypedConventionModel(configuration), + Model, new DefaultODataPathHandler(), ODataRoutingConventions.CreateDefault()); configuration.MapODataServiceRoute(Routings[1], Routings[1], OpenComplexTypeEdmModel.GetTypedConventionModel(configuration)); @@ -1640,7 +1641,7 @@ internal void GetMetadata() var strArray = directory.Split(new string[] { "bin" }, StringSplitOptions.None); var filePath = Path.Combine(strArray[0], @"src\Microsoft.Test.E2E.AspNet.OData\OpenType\TypedMetadata.csdl.xml"); - IEdmModel edmModel = OpenComplexTypeEdmModel.GetTypedConventionModel(_configuration); + IEdmModel edmModel = Model; XmlWriterSettings setting = new XmlWriterSettings(); setting.Indent = true; setting.NewLineOnAttributes = false; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ParameterAlias/ParameterAliasTest.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ParameterAlias/ParameterAliasTest.cs index 8a4e05e497..78e3191fd1 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ParameterAlias/ParameterAliasTest.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ParameterAlias/ParameterAliasTest.cs @@ -14,14 +14,14 @@ namespace Microsoft.Test.E2E.AspNet.OData.ParameterAlias { - public class ParameterAliasTest : WebHostTestBase + public class ParameterAliasTest : WebHostTestBase { - public ParameterAliasTest(WebHostTestFixture fixture) + public ParameterAliasTest(WebHostTestFixture fixture) :base(fixture) { } - protected override void UpdateConfiguration(WebRouteConfiguration configuration) + protected static void UpdateConfigure(WebRouteConfiguration configuration) { var controllers = new[] { typeof(TradesController) }; configuration.AddControllers(controllers); diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/AnonymousTypeTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/AnonymousTypeTests.cs index 417c8e3326..9c56d7d8e4 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/AnonymousTypeTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/AnonymousTypeTests.cs @@ -33,14 +33,14 @@ public IQueryable Get() } } - public class AnonymousTypeTests : WebHostTestBase + public class AnonymousTypeTests : WebHostTestBase { - public AnonymousTypeTests(WebHostTestFixture fixture) + public AnonymousTypeTests(WebHostTestFixture fixture) :base(fixture) { } - protected override void UpdateConfiguration(WebRouteConfiguration configuration) + protected static void UpdateConfigure(WebRouteConfiguration configuration) { configuration.JsonReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Ignore; configuration.Count().Filter().OrderBy().Expand().MaxTop(null); diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/ComplextTypeCollectionTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/ComplextTypeCollectionTests.cs index 49a790898e..a938bc0d60 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/ComplextTypeCollectionTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/ComplextTypeCollectionTests.cs @@ -17,14 +17,14 @@ namespace Microsoft.Test.E2E.AspNet.OData.QueryComposition { - public class ComplextTypeCollectionTests : WebHostTestBase + public class ComplextTypeCollectionTests : WebHostTestBase { - public ComplextTypeCollectionTests(WebHostTestFixture fixture) + public ComplextTypeCollectionTests(WebHostTestFixture fixture) :base(fixture) { } - protected override void UpdateConfiguration(WebRouteConfiguration configuration) + protected static void UpdateConfigure(WebRouteConfiguration configuration) { configuration.Routes.Clear(); diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/FilterTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/FilterTests.cs index af17393dfe..2fc84debd8 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/FilterTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/FilterTests.cs @@ -20,7 +20,7 @@ namespace Microsoft.Test.E2E.AspNet.OData.QueryComposition { - public class FilterTests : WebHostTestBase + public class FilterTests : WebHostTestBase { #region Test Data public static TheoryDataSet> SpecialCharacterData @@ -226,7 +226,7 @@ public static TheoryDataSet> AdHocTests } #endregion - public FilterTests(WebHostTestFixture fixture) + public FilterTests(WebHostTestFixture fixture) :base(fixture) { } @@ -236,7 +236,7 @@ private static string Encoding(string name) return name.Replace("'", "''").Replace("&", "%26").Replace("/", "%2F").Replace("?", "%3F"); } - protected override void UpdateConfiguration(WebRouteConfiguration configuration) + protected static void UpdateConfigure(WebRouteConfiguration configuration) { configuration.JsonReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Ignore; configuration.Count().Filter().OrderBy().Expand().MaxTop(null); diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/GlobalQueryableFilterTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/GlobalQueryableFilterTests.cs index 89dc179b3c..591a369f33 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/GlobalQueryableFilterTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/GlobalQueryableFilterTests.cs @@ -175,14 +175,14 @@ public IQueryable Get() } } - public class GlobalQueryableFilterWithoutResultLimitTests : WebHostTestBase + public class GlobalQueryableFilterWithoutResultLimitTests : WebHostTestBase { - public GlobalQueryableFilterWithoutResultLimitTests(WebHostTestFixture fixture) + public GlobalQueryableFilterWithoutResultLimitTests(WebHostTestFixture fixture) :base(fixture) { } - protected override void UpdateConfiguration(WebRouteConfiguration configuration) + protected static void UpdateConfigure(WebRouteConfiguration configuration) { configuration.AddODataQueryFilter(new EnableQueryAttribute() { PageSize = 3 }); configuration.Count().Filter().OrderBy().Expand().MaxTop(null); @@ -244,29 +244,14 @@ public virtual async Task TestQueryableAttributeWontAffectOtherActions(string ur } } - public class GlobalQueryableFilterWithResultLimitTests : GlobalQueryableFilterWithoutResultLimitTests + public class GlobalQueryableFilterWithDerivedEnableQueryAttribute : WebHostTestBase { - public GlobalQueryableFilterWithResultLimitTests(WebHostTestFixture fixture) + public GlobalQueryableFilterWithDerivedEnableQueryAttribute(WebHostTestFixture fixture) :base(fixture) { } - internal static void UpdateConfiguration1(WebRouteConfiguration configuration) - { - configuration.AddODataQueryFilter(new EnableQueryAttribute() { PageSize = 3 }); - configuration.Count().Filter().OrderBy().Expand().MaxTop(null); - configuration.EnableDependencyInjection(); - } - } - - public class GlobalQueryableFilterWithDerivedEnableQueryAttribute : WebHostTestBase - { - public GlobalQueryableFilterWithDerivedEnableQueryAttribute(WebHostTestFixture fixture) - :base(fixture) - { - } - - protected override void UpdateConfiguration(WebRouteConfiguration configuration) + protected static void UpdateConfigure(WebRouteConfiguration configuration) { configuration.AddODataQueryFilter(new DerivedQueryableAttribute()); configuration.Count().Filter().OrderBy().Expand().MaxTop(null); diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/InheritanceQueryableTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/InheritanceQueryableTests.cs index 14d3afc1d9..f6bad8f91c 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/InheritanceQueryableTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/InheritanceQueryableTests.cs @@ -172,25 +172,25 @@ public IQueryable GetReadOnlyPropertyType() } } - public class InheritanceQueryableTests : WebHostTestBase + public class InheritanceQueryableTests : WebHostTestBase { - public InheritanceQueryableTests(WebHostTestFixture fixture) + public InheritanceQueryableTests(WebHostTestFixture fixture) :base(fixture) { } - protected override void UpdateConfiguration(WebRouteConfiguration configuration) + protected static void UpdateConfigure(WebRouteConfiguration configuration) { - var types = new[] { - typeof(InheritanceQueryable_Customer), - typeof(InheritanceQueryable_AbstractBase), - typeof(InheritanceQueryable_DerivedType), - typeof(Vehicle), - typeof(Motorcycle), - typeof(MiniSportBike), - typeof(SportBike), - typeof(NameValueCollection), - typeof(ReadOnlyPropertyType), + var types = new[] { + typeof(InheritanceQueryable_Customer), + typeof(InheritanceQueryable_AbstractBase), + typeof(InheritanceQueryable_DerivedType), + typeof(Vehicle), + typeof(Motorcycle), + typeof(MiniSportBike), + typeof(SportBike), + typeof(NameValueCollection), + typeof(ReadOnlyPropertyType), typeof(InheritanceQueryableController) }; configuration.AddControllers(types); diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/InvalidQueryTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/InvalidQueryTests.cs index 0ce87624d0..89e89330fb 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/InvalidQueryTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/InvalidQueryTests.cs @@ -18,14 +18,14 @@ namespace Microsoft.Test.E2E.AspNet.OData.QueryComposition { - public class InvalidQueryTests : WebHostTestBase + public class InvalidQueryTests : WebHostTestBase { - public InvalidQueryTests(WebHostTestFixture fixture) + public InvalidQueryTests(WebHostTestFixture fixture) :base(fixture) { } - protected override void UpdateConfiguration(WebRouteConfiguration config) + protected static void UpdateConfigure(WebRouteConfiguration config) { config.Routes.Clear(); config.Count().Filter().OrderBy().Expand().MaxTop(null); diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/IsOf/IsofFunctionTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/IsOf/IsofFunctionTests.cs index 1dc737a4da..1f84c23133 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/IsOf/IsofFunctionTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/IsOf/IsofFunctionTests.cs @@ -17,16 +17,16 @@ namespace Microsoft.Test.E2E.AspNet.OData.QueryComposition.IsOf { - public class IsofFunctionTests : WebHostTestBase + public class IsofFunctionTests : WebHostTestBase { private static readonly string[] DataSourceTypes = new string[] {"IM", "EF"}; // In Memory or Entity Framework - public IsofFunctionTests(WebHostTestFixture fixture) + public IsofFunctionTests(WebHostTestFixture fixture) :base(fixture) { } - protected override void UpdateConfiguration(WebRouteConfiguration config) + protected static void UpdateConfigure(WebRouteConfiguration config) { var controllers = new[] {typeof (BillingCustomersController), typeof (BillingsController), typeof (MetadataController)}; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/JsonSelectExpandTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/JsonSelectExpandTests.cs index a5d30d2216..6c8a17d4f7 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/JsonSelectExpandTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/JsonSelectExpandTests.cs @@ -17,14 +17,14 @@ namespace Microsoft.Test.E2E.AspNet.OData.QueryComposition { - public class JsonSelectExpandTests : WebHostTestBase + public class JsonSelectExpandTests : WebHostTestBase { - public JsonSelectExpandTests(WebHostTestFixture fixture) + public JsonSelectExpandTests(WebHostTestFixture fixture) :base(fixture) { } - protected override void UpdateConfiguration(WebRouteConfiguration configuration) + protected static void UpdateConfigure(WebRouteConfiguration configuration) { configuration.JsonReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Ignore; configuration.JsonFormatterIndent = true; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/JsonSingleResultSelectExpandTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/JsonSingleResultSelectExpandTests.cs index 4d32991e0f..afdf846c26 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/JsonSingleResultSelectExpandTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/JsonSingleResultSelectExpandTests.cs @@ -17,14 +17,14 @@ namespace Microsoft.Test.E2E.AspNet.OData.QueryComposition { - public class JsonSingleResultExpandTests : WebHostTestBase + public class JsonSingleResultExpandTests : WebHostTestBase { - public JsonSingleResultExpandTests(WebHostTestFixture fixture) + public JsonSingleResultExpandTests(WebHostTestFixture fixture) :base(fixture) { } - protected override void UpdateConfiguration(WebRouteConfiguration configuration) + protected static void UpdateConfigure(WebRouteConfiguration configuration) { configuration.JsonReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Ignore; configuration.Routes.Clear(); diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/JsonpQueryableTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/JsonpQueryableTests.cs index 1df64195b0..9817588b48 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/JsonpQueryableTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/JsonpQueryableTests.cs @@ -150,14 +150,14 @@ public Task WriteJsonp(string jsonpCallback, Stream writeStream, Func base } } - public class JsonpQueryableTests : WebHostTestBase + public class JsonpQueryableTests : WebHostTestBase { - public JsonpQueryableTests(WebHostTestFixture fixture) + public JsonpQueryableTests(WebHostTestFixture fixture) :base(fixture) { } - protected override void UpdateConfiguration(WebRouteConfiguration configuration) + protected static void UpdateConfigure(WebRouteConfiguration configuration) { var f = JsonpMediaTypeFormatter.Create(configuration); configuration.RemoveNonODataFormatters(); diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/NestedClassTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/NestedClassTests.cs index c3630ff11f..2971039e79 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/NestedClassTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/NestedClassTests.cs @@ -51,14 +51,14 @@ public class NestedClassController : TestNonODataController } } - public class NestedClassTests : WebHostTestBase + public class NestedClassTests : WebHostTestBase { - public NestedClassTests(WebHostTestFixture fixture) + public NestedClassTests(WebHostTestFixture fixture) :base(fixture) { } - protected override void UpdateConfiguration(WebRouteConfiguration configuration) + protected static void UpdateConfigure(WebRouteConfiguration configuration) { configuration.JsonReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Ignore; configuration.Count().Filter().OrderBy().Expand().MaxTop(null); diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/ODataQueryOptionsTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/ODataQueryOptionsTests.cs index 8001b9c99f..5aad44c7ae 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/ODataQueryOptionsTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/ODataQueryOptionsTests.cs @@ -102,14 +102,14 @@ public CollectionOfStringResult OptionsWithString(ODataQueryOptions opti } } - public class ODataQueryOptionsTests : WebHostTestBase + public class ODataQueryOptionsTests : WebHostTestBase { - public ODataQueryOptionsTests(WebHostTestFixture fixture) + public ODataQueryOptionsTests(WebHostTestFixture fixture) :base(fixture) { } - protected override void UpdateConfiguration(WebRouteConfiguration configuration) + protected static void UpdateConfigure(WebRouteConfiguration configuration) { configuration.JsonReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Ignore; configuration.Count().Filter().OrderBy().Expand().MaxTop(null); diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/OrderByTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/OrderByTests.cs index 1d7e459b83..86a28aa28a 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/OrderByTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/OrderByTests.cs @@ -20,14 +20,14 @@ namespace Microsoft.Test.E2E.AspNet.OData.QueryComposition { - public class OrderByTests : WebHostTestBase + public class OrderByTests : WebHostTestBase { - public OrderByTests(WebHostTestFixture fixture) + public OrderByTests(WebHostTestFixture fixture) : base(fixture) { } - protected override void UpdateConfiguration(WebRouteConfiguration config) + protected static void UpdateConfigure(WebRouteConfiguration config) { config.Count().Filter().OrderBy().Expand().MaxTop(null); config.MapODataServiceRoute("odata", "odata", GetModel(config), new DefaultODataPathHandler(), ODataRoutingConventions.CreateDefault()); diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/PrimitiveTypesTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/PrimitiveTypesTests.cs index b691d4da61..c4e26d9990 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/PrimitiveTypesTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/PrimitiveTypesTests.cs @@ -36,14 +36,14 @@ public IEnumerable GetIEnumerableOfString() } } - public class PrimitiveTypesTests : WebHostTestBase + public class PrimitiveTypesTests : WebHostTestBase { - public PrimitiveTypesTests(WebHostTestFixture fixture) + public PrimitiveTypesTests(WebHostTestFixture fixture) :base(fixture) { } - protected override void UpdateConfiguration(WebRouteConfiguration configuration) + protected static void UpdateConfigure(WebRouteConfiguration configuration) { configuration.JsonReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Ignore; configuration.Count().Filter().OrderBy().Expand().MaxTop(null); diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/QueryFuzzingTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/QueryFuzzingTests.cs index 9112cba892..253d334e22 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/QueryFuzzingTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/QueryFuzzingTests.cs @@ -15,9 +15,9 @@ namespace Microsoft.Test.E2E.AspNet.OData.QueryComposition { - public class QueryFuzzingTests : WebHostTestBase + public class QueryFuzzingTests : WebHostTestBase { - public QueryFuzzingTests(WebHostTestFixture fixture) + public QueryFuzzingTests(WebHostTestFixture fixture) :base(fixture) { } @@ -59,7 +59,7 @@ public static TheoryDataSet AdHocQueries } } - protected override void UpdateConfiguration(WebRouteConfiguration configuration) + protected static void UpdateConfigure(WebRouteConfiguration configuration) { configuration.JsonReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Ignore; configuration.Count().Filter().OrderBy().Expand().MaxTop(null); diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/SecurityTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/SecurityTests.cs index e1d48656ce..8a2a64b1fc 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/SecurityTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/SecurityTests.cs @@ -11,9 +11,9 @@ namespace Microsoft.Test.E2E.AspNet.OData.QueryComposition { - public class SecurityTests : WebHostTestBase + public class SecurityTests : WebHostTestBase { - public SecurityTests(WebHostTestFixture fixture) + public SecurityTests(WebHostTestFixture fixture) :base(fixture) { } @@ -72,7 +72,7 @@ public static TheoryDataSet InvalidUnicodeData } } - protected override void UpdateConfiguration(WebRouteConfiguration configuration) + protected static void UpdateConfigure(WebRouteConfiguration configuration) { configuration.JsonReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Ignore; configuration.Count().Filter().OrderBy().Expand().MaxTop(null); diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/SelectExpandEFTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/SelectExpandEFTests.cs index c4e49f00f7..2df3470a63 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/SelectExpandEFTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/SelectExpandEFTests.cs @@ -21,14 +21,14 @@ namespace Microsoft.Test.E2E.AspNet.OData.QueryComposition { - public class SelectExpandEFTests : WebHostTestBase + public class SelectExpandEFTests : WebHostTestBase { - public SelectExpandEFTests(WebHostTestFixture fixture) + public SelectExpandEFTests(WebHostTestFixture fixture) : base(fixture) { } - protected override void UpdateConfiguration(WebRouteConfiguration configuration) + protected static void UpdateConfigure(WebRouteConfiguration configuration) { configuration.AddControllers( typeof(EFSelectCustomersController), diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/SelectExpandTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/SelectExpandTests.cs index 299e437841..f6d6ce89d2 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/SelectExpandTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/SelectExpandTests.cs @@ -21,9 +21,9 @@ namespace Microsoft.Test.E2E.AspNet.OData.QueryComposition { - public class SelectExpandTests : WebHostTestBase + public class SelectExpandTests : WebHostTestBase { - public SelectExpandTests(WebHostTestFixture fixture) + public SelectExpandTests(WebHostTestFixture fixture) : base(fixture) { } @@ -31,7 +31,7 @@ public SelectExpandTests(WebHostTestFixture fixture) private static readonly int SelectCustomerPropertyCount = typeof(SelectCustomer).GetProperties().Length + 1; // The +1 is for SelectOrders@odata.count. - protected override void UpdateConfiguration(WebRouteConfiguration configuration) + protected static void UpdateConfigure(WebRouteConfiguration configuration) { configuration.AddControllers(typeof(SelectCustomerController)); configuration.JsonReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Ignore; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/SelectTypeExplosionTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/SelectTypeExplosionTests.cs index 86605d7700..ff8607d03c 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/SelectTypeExplosionTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/SelectTypeExplosionTests.cs @@ -14,14 +14,14 @@ namespace Microsoft.Test.E2E.AspNet.OData.QueryComposition { - public class SelectTypeExplosionTests : WebHostTestBase + public class SelectTypeExplosionTests : WebHostTestBase { - public SelectTypeExplosionTests(WebHostTestFixture fixture) + public SelectTypeExplosionTests(WebHostTestFixture fixture) :base(fixture) { } - protected override void UpdateConfiguration(WebRouteConfiguration config) + protected static void UpdateConfigure(WebRouteConfiguration config) { config.Count().Filter().OrderBy().Expand().MaxTop(null); #if NETCORE diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/SingleResultSelectExpandTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/SingleResultSelectExpandTests.cs index 33b5ae3fca..156abf3399 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/SingleResultSelectExpandTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/SingleResultSelectExpandTests.cs @@ -19,14 +19,14 @@ namespace Microsoft.Test.E2E.AspNet.OData.QueryComposition { - public class SingleResultExpandTests : WebHostTestBase + public class SingleResultExpandTests : WebHostTestBase { - public SingleResultExpandTests(WebHostTestFixture fixture) + public SingleResultExpandTests(WebHostTestFixture fixture) :base(fixture) { } - protected override void UpdateConfiguration(WebRouteConfiguration configuration) + protected static void UpdateConfigure(WebRouteConfiguration configuration) { configuration.JsonReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Ignore; configuration.Count().Filter().OrderBy().Expand().MaxTop(null).Select(); diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/StableOrderTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/StableOrderTests.cs index d6a5146e1d..a9552ca685 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/StableOrderTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/StableOrderTests.cs @@ -75,14 +75,14 @@ public IEnumerable GetEnumerableWithResultLimit() } } - public class StableOrderWithoutResultLimitTests : WebHostTestBase + public class StableOrderWithoutResultLimitTests : WebHostTestBase { - public StableOrderWithoutResultLimitTests(WebHostTestFixture fixture) + public StableOrderWithoutResultLimitTests(WebHostTestFixture fixture) :base(fixture) { } - protected override void UpdateConfiguration(WebRouteConfiguration configuration) + protected static void UpdateConfigure(WebRouteConfiguration configuration) { configuration.Count().Filter().OrderBy().Expand().MaxTop(null); configuration.AddODataQueryFilter(); diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/TopSkipOrderByTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/TopSkipOrderByTests.cs index 99da74a5d9..e9d4105e3d 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/TopSkipOrderByTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/TopSkipOrderByTests.cs @@ -14,9 +14,9 @@ namespace Microsoft.Test.E2E.AspNet.OData.QueryComposition { - public class TopSkipOrderByTests : WebHostTestBase + public class TopSkipOrderByTests : WebHostTestBase { - public TopSkipOrderByTests(WebHostTestFixture fixture) + public TopSkipOrderByTests(WebHostTestFixture fixture) :base(fixture) { } @@ -34,7 +34,7 @@ public static TheoryDataSet ActionNames } } - protected override void UpdateConfiguration(WebRouteConfiguration configuration) + protected static void UpdateConfigure(WebRouteConfiguration configuration) { configuration.Count().Filter().OrderBy().Expand().MaxTop(null); configuration.EnableDependencyInjection(); diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/UriParserTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/UriParserTests.cs index e4caa4db4a..373b7a0de5 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/UriParserTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/UriParserTests.cs @@ -15,14 +15,14 @@ public class UriParser_Model1 public UriParser_Model1 Self { get; set; } } - public class UriParserTests : WebHostTestBase + public class UriParserTests : WebHostTestBase { - public UriParserTests(WebHostTestFixture fixture) + public UriParserTests(WebHostTestFixture fixture) :base(fixture) { } - protected override void UpdateConfiguration(WebRouteConfiguration configuration) + protected static void UpdateConfigure(WebRouteConfiguration configuration) { configuration.JsonReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Ignore; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/ValidatorTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/ValidatorTests.cs index 95c1dd9d3e..89fbccd3a8 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/ValidatorTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/ValidatorTests.cs @@ -190,9 +190,9 @@ public override void Validate(FilterQueryOption filterQueryOption, ODataValidati } } - public class ValidatorTests : WebHostTestBase + public class ValidatorTests : WebHostTestBase { - public ValidatorTests(WebHostTestFixture fixture) + public ValidatorTests(WebHostTestFixture fixture) :base(fixture) { } @@ -253,7 +253,7 @@ public static TheoryDataSet AllowedFunctions } } - protected override void UpdateConfiguration(WebRouteConfiguration configuration) + protected static void UpdateConfigure(WebRouteConfiguration configuration) { configuration.JsonReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Ignore; configuration.Count().Filter().OrderBy().Expand().MaxTop(null); diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Routing/ActionRoutingConventionTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Routing/ActionRoutingConventionTests.cs index 00b49b2b7a..4da0cb39af 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Routing/ActionRoutingConventionTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Routing/ActionRoutingConventionTests.cs @@ -16,14 +16,14 @@ namespace Microsoft.Test.E2E.AspNet.OData.Routing { - public class ActionRoutingConventionTests : WebHostTestBase + public class ActionRoutingConventionTests : WebHostTestBase { - public ActionRoutingConventionTests(WebHostTestFixture fixture) + public ActionRoutingConventionTests(WebHostTestFixture fixture) :base(fixture) { } - protected override void UpdateConfiguration(WebRouteConfiguration config) + protected static void UpdateConfigure(WebRouteConfiguration config) { config.Routes.Clear(); config.MapODataServiceRoute("odata", "odata", GetModel(config), new DefaultODataPathHandler(), ODataRoutingConventions.CreateDefault()); diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Routing/AddRelatedObjectTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Routing/AddRelatedObjectTests.cs index e73797c7a0..69d8afe421 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Routing/AddRelatedObjectTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Routing/AddRelatedObjectTests.cs @@ -39,14 +39,14 @@ namespace Microsoft.Test.E2E.AspNet.OData.Routing { - public class AddRelatedObjectTests : WebHostTestBase + public class AddRelatedObjectTests : WebHostTestBase { - public AddRelatedObjectTests(WebHostTestFixture fixture) + public AddRelatedObjectTests(WebHostTestFixture fixture) :base(fixture) { } - protected override void UpdateConfiguration(WebRouteConfiguration config) + protected static void UpdateConfigure(WebRouteConfiguration config) { config.Routes.Clear(); config.MapODataServiceRoute("odata", "", GetModel(config), new DefaultODataPathHandler(), ODataRoutingConventions.CreateDefault()); diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Routing/AttributeRoutingTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Routing/AttributeRoutingTests.cs index 597073c26d..8cc6154b26 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Routing/AttributeRoutingTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Routing/AttributeRoutingTests.cs @@ -19,14 +19,14 @@ namespace Microsoft.Test.E2E.AspNet.OData.Routing { - public class AttributeRoutingTests : WebHostTestBase + public class AttributeRoutingTests : WebHostTestBase { - public AttributeRoutingTests(WebHostTestFixture fixture) + public AttributeRoutingTests(WebHostTestFixture fixture) :base(fixture) { } - protected override void UpdateConfiguration(WebRouteConfiguration config) + protected static void UpdateConfigure(WebRouteConfiguration config) { config.Routes.Clear(); config.AddControllers(new Type[] { typeof(DogsController), typeof(CatsController), typeof(OwnersController) }); diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Routing/DynamicProperties/DynamicPropertiesTest.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Routing/DynamicProperties/DynamicPropertiesTest.cs index 88080bc2ed..d1a18bb9dc 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Routing/DynamicProperties/DynamicPropertiesTest.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Routing/DynamicProperties/DynamicPropertiesTest.cs @@ -13,14 +13,14 @@ namespace Microsoft.Test.E2E.AspNet.OData.Routing.DynamicProperties { - public class DynamicPropertiesTest : WebHostTestBase + public class DynamicPropertiesTest : WebHostTestBase { - public DynamicPropertiesTest(WebHostTestFixture fixture) + public DynamicPropertiesTest(WebHostTestFixture fixture) :base(fixture) { } - protected override void UpdateConfiguration(WebRouteConfiguration configuration) + protected static void UpdateConfigure(WebRouteConfiguration configuration) { var controllers = new[] { typeof(DynamicCustomersController), diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Routing/ODataRouteTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Routing/ODataRouteTests.cs index e31612d0d0..6449b6fafd 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Routing/ODataRouteTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Routing/ODataRouteTests.cs @@ -16,14 +16,14 @@ namespace Microsoft.Test.E2E.AspNet.OData.Routing { - public class ODataRouteTests : WebHostTestBase + public class ODataRouteTests : WebHostTestBase { - public ODataRouteTests(WebHostTestFixture fixture) + public ODataRouteTests(WebHostTestFixture fixture) :base(fixture) { } - protected override void UpdateConfiguration(WebRouteConfiguration configuration) + protected static void UpdateConfigure(WebRouteConfiguration configuration) { configuration.MapODataServiceRoute("noPrefix", "", GetEdmModel(configuration), new DefaultODataPathHandler(), ODataRoutingConventions.CreateDefault()); configuration.MapODataServiceRoute("prefix", "prefix", GetEdmModel(configuration), new DefaultODataPathHandler(), ODataRoutingConventions.CreateDefault()); diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Routing/ODataValueProviderTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Routing/ODataValueProviderTests.cs index a2e54d2163..66050e4900 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Routing/ODataValueProviderTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Routing/ODataValueProviderTests.cs @@ -44,14 +44,14 @@ namespace Microsoft.Test.E2E.AspNet.OData.Routing { - public class ODataValueProviderTests : WebHostTestBase + public class ODataValueProviderTests : WebHostTestBase { - public ODataValueProviderTests(WebHostTestFixture fixture) + public ODataValueProviderTests(WebHostTestFixture fixture) :base(fixture) { } - protected override void UpdateConfiguration(WebRouteConfiguration config) + protected static void UpdateConfigure(WebRouteConfiguration config) { config.Routes.Clear(); IList conventions = ODataRoutingConventions.CreateDefault(); diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Routing/RefRoutingConventionTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Routing/RefRoutingConventionTests.cs index 8e73405d4c..7747660bf9 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Routing/RefRoutingConventionTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Routing/RefRoutingConventionTests.cs @@ -20,14 +20,14 @@ namespace Microsoft.Test.E2E.AspNet.OData.Routing { - public class RefRoutingConventionTests : WebHostTestBase + public class RefRoutingConventionTests : WebHostTestBase { - public RefRoutingConventionTests(WebHostTestFixture fixture) + public RefRoutingConventionTests(WebHostTestFixture fixture) :base(fixture) { } - protected override void UpdateConfiguration(WebRouteConfiguration config) + protected static void UpdateConfigure(WebRouteConfiguration config) { var controllers = new[] { typeof(CustomersController), typeof(OrdersController), typeof(AddressesController) }; config.AddControllers(controllers); diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Routing/UnqualifiedNameCallRoutingTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Routing/UnqualifiedNameCallRoutingTests.cs index 2a6472a22e..cb4261be75 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Routing/UnqualifiedNameCallRoutingTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Routing/UnqualifiedNameCallRoutingTests.cs @@ -20,14 +20,14 @@ namespace Microsoft.Test.E2E.AspNet.OData.Routing { - public class UnqualifiedNameCallRoutingTests : WebHostTestBase + public class UnqualifiedNameCallRoutingTests : WebHostTestBase { - public UnqualifiedNameCallRoutingTests(WebHostTestFixture fixture) + public UnqualifiedNameCallRoutingTests(WebHostTestFixture fixture) :base(fixture) { } - protected override void UpdateConfiguration(WebRouteConfiguration config) + protected static void UpdateConfigure(WebRouteConfiguration config) { var controllers = new[] { typeof(UnqualifiedCarsController) }; config.AddControllers(controllers); diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/SingleResult/SingleResultTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/SingleResult/SingleResultTests.cs index 3d245d2f9b..91e2962a61 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/SingleResult/SingleResultTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/SingleResult/SingleResultTests.cs @@ -11,16 +11,16 @@ namespace Microsoft.Test.E2E.AspNet.OData.SingleResultTest { - public class SingleResultTests : WebHostTestBase + public class SingleResultTests : WebHostTestBase { private const string BaseUrl = "{0}/singleresult/Customers"; - public SingleResultTests(WebHostTestFixture fixture) + public SingleResultTests(WebHostTestFixture fixture) :base(fixture) { } - protected override void UpdateConfiguration(WebRouteConfiguration configuration) + protected static void UpdateConfigure(WebRouteConfiguration configuration) { configuration.AddControllers(typeof (CustomersController)); configuration.JsonReferenceLoopHandling = diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Singleton/PartnersController.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Singleton/PartnersController.cs index 47d957ab5e..b9a98d8b35 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Singleton/PartnersController.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Singleton/PartnersController.cs @@ -82,7 +82,7 @@ public ITestActionResult CreateRef([FromODataUri] int key, string navigationProp if (company == "Umbrella") { - Partners.First(e => e.ID == key).Company = UmbrellaController.Umbrella; + Partners.First(e => e.ID == key).Company = UmbrellaController.Umbrella; } else if (company == "MonstersInc") { diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Singleton/SingletonClientTest.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Singleton/SingletonClientTest.cs index e72d64a7af..a05ba3a903 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Singleton/SingletonClientTest.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Singleton/SingletonClientTest.cs @@ -15,14 +15,15 @@ namespace Microsoft.Test.E2E.AspNet.OData.Singleton { - public class SingletonClientTest : WebHostTestBase + [Collection("ASP.NET OData E2E NonParallel Collection #1")] + public class SingletonClientTest : WebHostTestBase { - public SingletonClientTest(WebHostTestFixture fixture) + public SingletonClientTest(WebHostTestFixture fixture) :base(fixture) { } - protected override void UpdateConfiguration(WebRouteConfiguration configuration) + protected static void UpdateConfigure(WebRouteConfiguration configuration) { configuration.Routes.Clear(); configuration.Count().Filter().OrderBy().Expand().MaxTop(null); diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Singleton/SingletonTest.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Singleton/SingletonTest.cs index 470934f049..33c0c5bdb5 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Singleton/SingletonTest.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Singleton/SingletonTest.cs @@ -37,16 +37,17 @@ namespace Microsoft.Test.E2E.AspNet.OData.Singleton { - public class SingletonTest : WebHostTestBase + [Collection("ASP.NET OData E2E NonParallel Collection #1")] + public class SingletonTest : WebHostTestBase { private const string NameSpace = "Microsoft.Test.E2E.AspNet.OData.Singleton"; - public SingletonTest(WebHostTestFixture fixture) + public SingletonTest(WebHostTestFixture fixture) :base(fixture) { } - protected override void UpdateConfiguration(WebRouteConfiguration configuration) + protected static void UpdateConfigure(WebRouteConfiguration configuration) { var controllers = new[] { typeof(UmbrellaController), typeof(MonstersIncController), typeof(MetadataController), typeof(PartnersController) }; configuration.AddControllers(controllers); diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Spatial/SpatialTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Spatial/SpatialTests.cs index fa9ed81df2..f4002688ed 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Spatial/SpatialTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Spatial/SpatialTests.cs @@ -18,14 +18,14 @@ namespace Microsoft.Test.E2E.AspNet.OData.Spatial { - public class SpatialTests : WebHostTestBase + public class SpatialTests : WebHostTestBase { - public SpatialTests(WebHostTestFixture fixture) + public SpatialTests(WebHostTestFixture fixture) : base(fixture) { } - protected override void UpdateConfiguration(WebRouteConfiguration configuration) + protected static void UpdateConfigure(WebRouteConfiguration configuration) { var controllers = new[] { typeof(SpatialCustomersController), typeof(MetadataController) }; configuration.AddControllers(controllers); diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Swagger/SwaggerMetadataTest.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Swagger/SwaggerMetadataTest.cs index 7f668cf919..d9ea6cafbe 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Swagger/SwaggerMetadataTest.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Swagger/SwaggerMetadataTest.cs @@ -21,14 +21,14 @@ namespace Microsoft.Test.E2E.AspNet.OData.Swagger { - public class SwaggerMetadataTest : WebHostTestBase + public class SwaggerMetadataTest : WebHostTestBase { - public SwaggerMetadataTest(WebHostTestFixture fixture) + public SwaggerMetadataTest(WebHostTestFixture fixture) :base(fixture) { } - protected override void UpdateConfiguration(WebRouteConfiguration configuration) + protected static void UpdateConfigure(WebRouteConfiguration configuration) { var controllers = new[] { typeof(SwaggerController), typeof(MetadataController)}; configuration.AddControllers(controllers); diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/SxS/SxSODataV3AndV4Test.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/SxS/SxSODataV3AndV4Test.cs index f37cb2359f..2ff7d935e4 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/SxS/SxSODataV3AndV4Test.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/SxS/SxSODataV3AndV4Test.cs @@ -15,14 +15,14 @@ namespace Microsoft.Test.E2E.AspNet.OData.SxS { - public class SxSODataV3AndV4Test : WebHostTestBase + public class SxSODataV3AndV4Test : WebHostTestBase { - public SxSODataV3AndV4Test(WebHostTestFixture fixture) + public SxSODataV3AndV4Test(WebHostTestFixture fixture) :base(fixture) { } - protected override void UpdateConfiguration(WebRouteConfiguration configuration) + protected static void UpdateConfigure(WebRouteConfiguration configuration) { var controllers = new[] { diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/SxS2/SxSODataV3AndV4Test.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/SxS2/SxSODataV3AndV4Test.cs index e460e55d83..a33f6858a4 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/SxS2/SxSODataV3AndV4Test.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/SxS2/SxSODataV3AndV4Test.cs @@ -15,19 +15,19 @@ namespace Microsoft.Test.E2E.AspNet.OData.SxS2 { - public class SxSODataV3AndV4Test : WebHostTestBase + public class SxSODataV3AndV4Test : WebHostTestBase { - public SxSODataV3AndV4Test(WebHostTestFixture fixture) + public SxSODataV3AndV4Test(WebHostTestFixture fixture) :base(fixture) { } - protected override void UpdateConfiguration(WebRouteConfiguration configuration) + protected static void UpdateConfigure(WebRouteConfiguration configuration) { var controllers = new[] { - typeof(ProductsController), typeof(ODataV3Stack.ODataMetadataController), - typeof(ProductsV2Controller), typeof(ODataV4Stack.MetadataController) + typeof(ProductsController), typeof(ODataV3Stack.ODataMetadataController), + typeof(ProductsV2Controller), typeof(ODataV4Stack.MetadataController) }; configuration.AddControllers(controllers); diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/UnboundOperation/UnboundOperationTest.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/UnboundOperation/UnboundOperationTest.cs index e264b10589..ec2ea65662 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/UnboundOperation/UnboundOperationTest.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/UnboundOperation/UnboundOperationTest.cs @@ -16,14 +16,13 @@ using Microsoft.Test.E2E.AspNet.OData.Common.Execution; using Microsoft.Test.E2E.AspNet.OData.Common.Extensions; using Microsoft.Test.E2E.AspNet.OData.ModelBuilder; -using Newtonsoft.Json.Linq; using Xunit; namespace Microsoft.Test.E2E.AspNet.OData.UnboundOperation { - public class UnboundOperationTest : WebHostTestBase + public class UnboundOperationTest : WebHostTestBase { - public UnboundOperationTest(WebHostTestFixture fixture) + public UnboundOperationTest(WebHostTestFixture fixture) :base(fixture) { } @@ -32,7 +31,7 @@ public UnboundOperationTest(WebHostTestFixture fixture) private readonly string EdmSchemaNamespace = typeof(ConventionCustomer).Namespace; - protected override void UpdateConfiguration(WebRouteConfiguration configuration) + protected static void UpdateConfigure(WebRouteConfiguration configuration) { var controllers = new[] { typeof(ConventionCustomersController), diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/UriParserExtension/CaseInsensitiveTest.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/UriParserExtension/CaseInsensitiveTest.cs index 056bb55d4c..165817e752 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/UriParserExtension/CaseInsensitiveTest.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/UriParserExtension/CaseInsensitiveTest.cs @@ -16,14 +16,14 @@ namespace Microsoft.Test.E2E.AspNet.OData.UriParserExtension { - public class CaseInsensitiveTest : WebHostTestBase + public class CaseInsensitiveTest : WebHostTestBase { - public CaseInsensitiveTest(WebHostTestFixture fixture) + public CaseInsensitiveTest(WebHostTestFixture fixture) :base(fixture) { } - protected override void UpdateConfiguration(WebRouteConfiguration configuration) + protected static void UpdateConfigure(WebRouteConfiguration configuration) { var controllers = new[] { typeof(CustomersController), typeof(OrdersController), typeof(MetadataController) }; configuration.AddControllers(controllers); diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/UriParserExtension/EnumPrefixFreeTest.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/UriParserExtension/EnumPrefixFreeTest.cs index c70b6549f5..482a28b59b 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/UriParserExtension/EnumPrefixFreeTest.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/UriParserExtension/EnumPrefixFreeTest.cs @@ -16,14 +16,14 @@ namespace Microsoft.Test.E2E.AspNet.OData.UriParserExtension { - public class EnumPrefixFreeTest : WebHostTestBase + public class EnumPrefixFreeTest : WebHostTestBase { - public EnumPrefixFreeTest(WebHostTestFixture fixture) + public EnumPrefixFreeTest(WebHostTestFixture fixture) :base(fixture) { } - protected override void UpdateConfiguration(WebRouteConfiguration configuration) + protected static void UpdateConfigure(WebRouteConfiguration configuration) { var controllers = new[] { typeof(CustomersController), typeof(OrdersController), typeof(MetadataController) }; configuration.AddControllers(controllers); diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/UriParserExtension/UnqualifiedCallTest.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/UriParserExtension/UnqualifiedCallTest.cs index 49d604b5a0..8450975878 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/UriParserExtension/UnqualifiedCallTest.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/UriParserExtension/UnqualifiedCallTest.cs @@ -16,14 +16,14 @@ namespace Microsoft.Test.E2E.AspNet.OData.UriParserExtension { - public class UnqualifiedCallTest : WebHostTestBase + public class UnqualifiedCallTest : WebHostTestBase { - public UnqualifiedCallTest(WebHostTestFixture fixture) + public UnqualifiedCallTest(WebHostTestFixture fixture) :base(fixture) { } - protected override void UpdateConfiguration(WebRouteConfiguration configuration) + protected static void UpdateConfigure(WebRouteConfiguration configuration) { var controllers = new[] { typeof(CustomersController), typeof(OrdersController), typeof(MetadataController) }; configuration.AddControllers(controllers); diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/UriParserExtension/UriResolverDependencyTestWithOldDefaultConfig.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/UriParserExtension/UriResolverDependencyTestWithOldDefaultConfig.cs index 7eeca70581..466eb1e801 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/UriParserExtension/UriResolverDependencyTestWithOldDefaultConfig.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/UriParserExtension/UriResolverDependencyTestWithOldDefaultConfig.cs @@ -16,14 +16,14 @@ namespace Microsoft.Test.E2E.AspNet.OData.UriParserExtension { - public class UnqualifiedCallTestWithOldDefaultConfig : WebHostTestBase + public class UnqualifiedCallTestWithOldDefaultConfig : WebHostTestBase { - public UnqualifiedCallTestWithOldDefaultConfig(WebHostTestFixture fixture) + public UnqualifiedCallTestWithOldDefaultConfig(WebHostTestFixture fixture) : base(fixture) { } - protected override void UpdateConfiguration(WebRouteConfiguration configuration) + protected static void UpdateConfigure(WebRouteConfiguration configuration) { var controllers = new[] { typeof(CustomersController), typeof(OrdersController), typeof(MetadataController) }; configuration.AddControllers(controllers); diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Validation/DeltaOfTValidationTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Validation/DeltaOfTValidationTests.cs index 1982765142..ccbd984657 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Validation/DeltaOfTValidationTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Validation/DeltaOfTValidationTests.cs @@ -20,14 +20,14 @@ namespace Microsoft.Test.E2E.AspNet.OData.Validation { - public class DeltaOfTValidationTests : WebHostTestBase + public class DeltaOfTValidationTests : WebHostTestBase { - public DeltaOfTValidationTests(WebHostTestFixture fixture) + public DeltaOfTValidationTests(WebHostTestFixture fixture) :base(fixture) { } - protected override void UpdateConfiguration(WebRouteConfiguration config) + protected static void UpdateConfigure(WebRouteConfiguration config) { config.Routes.Clear(); config.MapODataServiceRoute("odata", "odata", GetModel(config), new DefaultODataPathHandler(), ODataRoutingConventions.CreateDefault());