-
Notifications
You must be signed in to change notification settings - Fork 115
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
allow dup alias & target on main branch
- Loading branch information
1 parent
ab6d10f
commit 15d6a07
Showing
6 changed files
with
249 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
73 changes: 73 additions & 0 deletions
73
tests/Tests.FeatureManagement/FiltersWithDuplicatedAlias.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT license. | ||
// | ||
using Microsoft.FeatureManagement; | ||
using System.Threading.Tasks; | ||
|
||
namespace Tests.FeatureManagement | ||
{ | ||
interface IDummyContext | ||
{ | ||
string DummyProperty { get; } | ||
} | ||
|
||
class DummyContext : IDummyContext | ||
{ | ||
public string DummyProperty { get; set; } | ||
} | ||
|
||
[FilterAlias(Alias)] | ||
class DuplicatedAliasFeatureFilter1 : IFeatureFilter | ||
{ | ||
private const string Alias = "DuplicatedFilterName"; | ||
|
||
public Task<bool> EvaluateAsync(FeatureFilterEvaluationContext context) | ||
{ | ||
return Task.FromResult(true); | ||
} | ||
} | ||
|
||
[FilterAlias(Alias)] | ||
class DuplicatedAliasFeatureFilter2 : IFeatureFilter | ||
{ | ||
private const string Alias = "DuplicatedFilterName"; | ||
|
||
public Task<bool> EvaluateAsync(FeatureFilterEvaluationContext context) | ||
{ | ||
return Task.FromResult(true); | ||
} | ||
} | ||
|
||
[FilterAlias(Alias)] | ||
class ContextualDuplicatedAliasFeatureFilterWithAccountContext : IContextualFeatureFilter<IAccountContext> | ||
{ | ||
private const string Alias = "DuplicatedFilterName"; | ||
|
||
public Task<bool> EvaluateAsync(FeatureFilterEvaluationContext context, IAccountContext accountContext) | ||
{ | ||
return Task.FromResult(true); | ||
} | ||
} | ||
|
||
[FilterAlias(Alias)] | ||
class ContextualDuplicatedAliasFeatureFilterWithDummyContext1 : IContextualFeatureFilter<IDummyContext> | ||
{ | ||
private const string Alias = "DuplicatedFilterName"; | ||
|
||
public Task<bool> EvaluateAsync(FeatureFilterEvaluationContext context, IDummyContext dummyContext) | ||
{ | ||
return Task.FromResult(true); | ||
} | ||
} | ||
|
||
[FilterAlias(Alias)] | ||
class ContextualDuplicatedAliasFeatureFilterWithDummyContext2 : IContextualFeatureFilter<IDummyContext> | ||
{ | ||
private const string Alias = "DuplicatedFilterName"; | ||
|
||
public Task<bool> EvaluateAsync(FeatureFilterEvaluationContext context, IDummyContext dummyContext) | ||
{ | ||
return Task.FromResult(true); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters