File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -7,10 +7,26 @@ namespace Tests;
77internal class DelegatesTests : TestMethods
88{
99 [ Test ]
10- public void Delegate ( )
10+ public void DelegateWithOneArgument ( )
1111 {
1212 var referenced = "public delegate bool MyDelegate(int i);" ;
1313 var referencing = Class ( "MyDelegate MakeDelegate() => i => i > 3;" , "ReferencingClass" ) ;
1414 ContractAssertionShouldCompile ( referencing , referenced ) ;
1515 }
16- }
16+
17+ [ Test , Ignore ( "Not sure how to infer the delegate's signature" ) ]
18+ public void DelegateWithTwoArguments ( )
19+ {
20+ var referenced = "public delegate bool MyDelegate(int i, int j);" ;
21+ var referencing = Class ( "MyDelegate MakeDelegate() => (i, j) => i > j;" , "ReferencingClass" ) ;
22+ ContractAssertionShouldCompile ( referencing , referenced ) ;
23+ }
24+
25+ [ Test , Ignore ( "Not sure how to infer the delegate's signature" ) ]
26+ public void VoidDelegate ( )
27+ {
28+ var referenced = "public delegate void MyDelegate(int i);" ;
29+ var referencing = Class ( "MyDelegate MakeDelegate() => i => {};" , "ReferencingClass" ) ;
30+ ContractAssertionShouldCompile ( referencing , referenced ) ;
31+ }
32+ }
You can’t perform that action at this time.
0 commit comments