File tree Expand file tree Collapse file tree 2 files changed +27
-0
lines changed
src/LeanCode.ContractsGenerator.Tests/ExampleBased Expand file tree Collapse file tree 2 files changed +27
-0
lines changed Original file line number Diff line number Diff line change 1+ using LeanCode . Contracts ;
2+ using LeanCode . Contracts . Security ;
3+
4+ [ AuthorizeWhenHasAnyOf ( new [ ] { "P1" , "P2" } ) ]
5+ public class A : ICommand { }
6+
7+ [ AuthorizeWhenHasAnyOf ( "P1" , "P2" ) ]
8+ public class B : ICommand { }
Original file line number Diff line number Diff line change @@ -70,4 +70,23 @@ public void AuthorizeWhen_attribute_is_correctly_propagated()
7070 . WithDto ( "AuthorizeWhenCustomGenericAttribute" )
7171 . ThatExtends ( Known ( KnownType . AuthorizeWhenAttribute ) ) ;
7272 }
73+
74+ [ Fact ]
75+ public void AuthorizeWhen_array_params ( )
76+ {
77+ "attributes/authorize_when_array_params.cs"
78+ . Compiles ( )
79+ . WithCommand ( "A" )
80+ . WithAttribute (
81+ "LeanCode.Contracts.Security.AuthorizeWhenHasAnyOfAttribute" ,
82+ Positional ( 0 , "P1" ) ,
83+ Positional ( 1 , "P2" )
84+ )
85+ . WithCommand ( "B" )
86+ . WithAttribute (
87+ "LeanCode.Contracts.Security.AuthorizeWhenHasAnyOfAttribute" ,
88+ Positional ( 0 , "P1" ) ,
89+ Positional ( 1 , "P2" )
90+ ) ;
91+ }
7392}
You can’t perform that action at this time.
0 commit comments