Skip to content

Commit ac8f8f4

Browse files
Merge branch 'main' into zhiyuanliang/recurring-time-window
2 parents 341f78f + 709bbeb commit ac8f8f4

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

tests/Tests.FeatureManagement.AspNetCore/FeatureManagementAspNetCore.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,12 @@ public async Task Integrates()
3636
services.AddMvcCore(o =>
3737
{
3838
DisableEndpointRouting(o);
39-
o.Filters.AddForFeature<MvcFilter>(Enum.GetName(typeof(Features), Features.ConditionalFeature));
39+
o.Filters.AddForFeature<MvcFilter>(Features.ConditionalFeature);
4040
});
4141
})
4242
.Configure(app =>
4343
{
44-
app.UseForFeature(Enum.GetName(typeof(Features), Features.ConditionalFeature), a => a.Use(async (ctx, next) =>
44+
app.UseForFeature(Features.ConditionalFeature, a => a.Use(async (ctx, next) =>
4545
{
4646
ctx.Response.Headers[nameof(RouterMiddleware)] = bool.TrueString;
4747

@@ -102,7 +102,7 @@ public async Task GatesFeatures()
102102

103103
//
104104
// Enable 1/2 features
105-
testFeatureFilter.Callback = ctx => Task.FromResult(ctx.FeatureName == Enum.GetName(typeof(Features), Features.ConditionalFeature));
105+
testFeatureFilter.Callback = ctx => Task.FromResult(ctx.FeatureName == Features.ConditionalFeature);
106106

107107
gateAllResponse = await testServer.CreateClient().GetAsync("gateAll");
108108
gateAnyResponse = await testServer.CreateClient().GetAsync("gateAny");
@@ -158,7 +158,7 @@ public async Task GatesRazorPageFeatures()
158158

159159
//
160160
// Enable 1/2 features
161-
testFeatureFilter.Callback = ctx => Task.FromResult(ctx.FeatureName == Enum.GetName(typeof(Features), Features.ConditionalFeature));
161+
testFeatureFilter.Callback = ctx => Task.FromResult(ctx.FeatureName == Features.ConditionalFeature);
162162

163163
gateAllResponse = await testServer.CreateClient().GetAsync("RazorTestAll");
164164
gateAnyResponse = await testServer.CreateClient().GetAsync("RazorTestAny");

tests/Tests.FeatureManagement.AspNetCore/Features.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
//
44
namespace Tests.FeatureManagement.AspNetCore
55
{
6-
enum Features
6+
static class Features
77
{
8-
ConditionalFeature,
9-
ConditionalFeature2
8+
public const string ConditionalFeature = "ConditionalFeature";
9+
public const string ConditionalFeature2 = "ConditionalFeature2";
1010
}
1111
}

0 commit comments

Comments
 (0)