Skip to content

Commit f468b2a

Browse files
committed
C#: Add tests for generic interfaces/classes/methods
1 parent 8472b84 commit f468b2a

File tree

4 files changed

+42
-0
lines changed

4 files changed

+42
-0
lines changed

csharp/ql/test/utils/modeleditor/FetchApplicationModeMethods.expected

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,7 @@
55
| PublicClass.cs:19:33:19:50 | call to method ReadLine | System.Console#ReadLine() | true | supported | System.Console | 7.0.0.0 | neutral | type | source | classification |
66
| PublicClass.cs:19:33:19:50 | call to method ReadLine | System.Console#ReadLine() | true | supported | System.Console | 7.0.0.0 | source | type | source | classification |
77
| PublicClass.cs:24:9:24:30 | call to method WriteLine | System.Console#WriteLine(System.String) | true | supported | System.Console | 7.0.0.0 | neutral | type | source | classification |
8+
| PublicGenericClass.cs:9:9:9:30 | call to method WriteLine | System.Console#WriteLine(System.Object) | true | supported | System.Console | 7.0.0.0 | neutral | type | source | classification |
9+
| PublicGenericClass.cs:14:9:14:30 | call to method WriteLine | System.Console#WriteLine(System.Object) | true | supported | System.Console | 7.0.0.0 | neutral | type | source | classification |
10+
| PublicGenericInterface.cs:13:9:13:30 | call to method WriteLine | System.Console#WriteLine(System.String) | true | supported | System.Console | 7.0.0.0 | neutral | type | source | classification |
811
| PublicInterface.cs:13:9:13:30 | call to method WriteLine | System.Console#WriteLine(System.String) | true | supported | System.Console | 7.0.0.0 | neutral | type | source | classification |

csharp/ql/test/utils/modeleditor/FetchFrameworkModeMethods.expected

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,14 @@
33
| PublicClass.cs:17:20:17:33 | nonPublicStuff | GitHub.CodeQL.PublicClass#nonPublicStuff(System.String) | false | supported | PublicClass.cs | library | | type | unknown | classification |
44
| PublicClass.cs:27:45:27:47 | get_PublicProperty | GitHub.CodeQL.PublicClass#get_PublicProperty() | false | supported | PublicClass.cs | library | | type | unknown | classification |
55
| PublicClass.cs:27:50:27:52 | set_PublicProperty | GitHub.CodeQL.PublicClass#set_PublicProperty(System.String) | false | supported | PublicClass.cs | library | | type | unknown | classification |
6+
| PublicGenericClass.cs:7:17:7:21 | stuff | GitHub.CodeQL.PublicGenericClass<,>#stuff(T) | false | supported | PublicGenericClass.cs | library | | type | unknown | classification |
7+
| PublicGenericClass.cs:12:17:12:26 | stuff2<> | GitHub.CodeQL.PublicGenericClass<,>#stuff2<>(T2) | false | supported | PublicGenericClass.cs | library | | type | unknown | classification |
8+
| PublicGenericInterface.cs:7:10:7:14 | stuff | GitHub.CodeQL.PublicGenericInterface<>#stuff(T) | false | supported | PublicGenericInterface.cs | library | | type | unknown | classification |
9+
| PublicGenericInterface.cs:7:10:7:14 | stuff | GitHub.CodeQL.PublicGenericInterface<>#stuff(T) | false | supported | PublicGenericInterface.cs | library | | type | unknown | classification |
10+
| PublicGenericInterface.cs:9:10:9:19 | stuff2<> | GitHub.CodeQL.PublicGenericInterface<>#stuff2<>(T2) | false | supported | PublicGenericInterface.cs | library | | type | unknown | classification |
11+
| PublicGenericInterface.cs:9:10:9:19 | stuff2<> | GitHub.CodeQL.PublicGenericInterface<>#stuff2<>(T2) | false | supported | PublicGenericInterface.cs | library | | type | unknown | classification |
12+
| PublicGenericInterface.cs:11:17:11:27 | staticStuff | GitHub.CodeQL.PublicGenericInterface<>#staticStuff(System.String) | false | supported | PublicGenericInterface.cs | library | | type | unknown | classification |
13+
| PublicGenericInterface.cs:11:17:11:27 | staticStuff | GitHub.CodeQL.PublicGenericInterface<>#staticStuff(System.String) | false | supported | PublicGenericInterface.cs | library | | type | unknown | classification |
614
| PublicInterface.cs:7:10:7:14 | stuff | GitHub.CodeQL.PublicInterface#stuff(System.String) | false | supported | PublicInterface.cs | library | | type | unknown | classification |
715
| PublicInterface.cs:9:29:9:31 | get_PublicProperty | GitHub.CodeQL.PublicInterface#get_PublicProperty() | false | supported | PublicInterface.cs | library | | type | unknown | classification |
816
| PublicInterface.cs:9:34:9:36 | set_PublicProperty | GitHub.CodeQL.PublicInterface#set_PublicProperty(System.String) | false | supported | PublicInterface.cs | library | | type | unknown | classification |
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
using System;
2+
3+
namespace GitHub.CodeQL;
4+
5+
public class PublicGenericClass<T, T2> : PublicGenericInterface<T>
6+
{
7+
public void stuff(T arg)
8+
{
9+
Console.WriteLine(arg);
10+
}
11+
12+
public void stuff2<T2>(T2 arg)
13+
{
14+
Console.WriteLine(arg);
15+
}
16+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
using System;
2+
3+
namespace GitHub.CodeQL;
4+
5+
public interface PublicGenericInterface<T>
6+
{
7+
void stuff(T arg);
8+
9+
void stuff2<T2>(T2 arg);
10+
11+
static void staticStuff(String arg)
12+
{
13+
Console.WriteLine(arg);
14+
}
15+
}

0 commit comments

Comments
 (0)