diff --git a/tests/Tests.FeatureManagement.AspNetCore/FeatureManagementAspNetCore.cs b/tests/Tests.FeatureManagement.AspNetCore/FeatureManagementAspNetCore.cs index 62919797..3e5d6aa0 100644 --- a/tests/Tests.FeatureManagement.AspNetCore/FeatureManagementAspNetCore.cs +++ b/tests/Tests.FeatureManagement.AspNetCore/FeatureManagementAspNetCore.cs @@ -36,12 +36,12 @@ public async Task Integrates() services.AddMvcCore(o => { DisableEndpointRouting(o); - o.Filters.AddForFeature(Enum.GetName(typeof(Features), Features.ConditionalFeature)); + o.Filters.AddForFeature(Features.ConditionalFeature); }); }) .Configure(app => { - app.UseForFeature(Enum.GetName(typeof(Features), Features.ConditionalFeature), a => a.Use(async (ctx, next) => + app.UseForFeature(Features.ConditionalFeature, a => a.Use(async (ctx, next) => { ctx.Response.Headers[nameof(RouterMiddleware)] = bool.TrueString; @@ -102,7 +102,7 @@ public async Task GatesFeatures() // // Enable 1/2 features - testFeatureFilter.Callback = ctx => Task.FromResult(ctx.FeatureName == Enum.GetName(typeof(Features), Features.ConditionalFeature)); + testFeatureFilter.Callback = ctx => Task.FromResult(ctx.FeatureName == Features.ConditionalFeature); gateAllResponse = await testServer.CreateClient().GetAsync("gateAll"); gateAnyResponse = await testServer.CreateClient().GetAsync("gateAny"); @@ -158,7 +158,7 @@ public async Task GatesRazorPageFeatures() // // Enable 1/2 features - testFeatureFilter.Callback = ctx => Task.FromResult(ctx.FeatureName == Enum.GetName(typeof(Features), Features.ConditionalFeature)); + testFeatureFilter.Callback = ctx => Task.FromResult(ctx.FeatureName == Features.ConditionalFeature); gateAllResponse = await testServer.CreateClient().GetAsync("RazorTestAll"); gateAnyResponse = await testServer.CreateClient().GetAsync("RazorTestAny"); diff --git a/tests/Tests.FeatureManagement.AspNetCore/Features.cs b/tests/Tests.FeatureManagement.AspNetCore/Features.cs index 5d26be98..d3397a05 100644 --- a/tests/Tests.FeatureManagement.AspNetCore/Features.cs +++ b/tests/Tests.FeatureManagement.AspNetCore/Features.cs @@ -3,9 +3,9 @@ // namespace Tests.FeatureManagement.AspNetCore { - enum Features + static class Features { - ConditionalFeature, - ConditionalFeature2 + public const string ConditionalFeature = "ConditionalFeature"; + public const string ConditionalFeature2 = "ConditionalFeature2"; } }