-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #232 from sungam3r/expressions
Fix generic arguments for array types
- Loading branch information
Showing
2 changed files
with
43 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
using PublicApiGeneratorTests.Examples; | ||
using System; | ||
using System.Linq.Expressions; | ||
using Xunit; | ||
|
||
namespace PublicApiGeneratorTests | ||
{ | ||
public class Expressions : ApiGeneratorTestsBase | ||
{ | ||
[Fact] | ||
public void Should_write_expression() | ||
{ | ||
AssertPublicApi(typeof(ClassWithExpressions<>), | ||
@"namespace PublicApiGeneratorTests.Examples | ||
{ | ||
public class ClassWithExpressions<TSourceType> | ||
{ | ||
public ClassWithExpressions(params System.Linq.Expressions.Expression<System.Func<int, object>>[] expr1) { } | ||
public ClassWithExpressions(params System.Linq.Expressions.Expression<System.Func<TSourceType, object?>>[] expr2) { } | ||
public ClassWithExpressions(System.Linq.Expressions.Expression<System.Func<TSourceType, object>?> expr3) { } | ||
public ClassWithExpressions(System.Linq.Expressions.Expression<System.Func<int, object>>? expr4) { } | ||
} | ||
}"); | ||
} | ||
} | ||
|
||
namespace Examples | ||
{ | ||
public class ClassWithExpressions<TSourceType> | ||
{ | ||
public ClassWithExpressions(params Expression<Func<int, object>>[] expr1) { } | ||
public ClassWithExpressions(params Expression<Func<TSourceType, object?>>[] expr2) { } | ||
public ClassWithExpressions(Expression<Func<TSourceType, object>?> expr3) { } | ||
public ClassWithExpressions(Expression<Func<int, object>>? expr4) { } | ||
} | ||
} | ||
} |