Skip to content

Commit e53382c

Browse files
authored
Merge pull request #10465 from michaelnebel/csharp/integration-tests
C#: Integration test(s)
2 parents 76dfcad + d29bc68 commit e53382c

File tree

10 files changed

+77
-0
lines changed

10 files changed

+77
-0
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
// See https://aka.ms/new-console-template for more information
2+
Console.WriteLine("Hello, World!");
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<OutputType>Exe</OutputType>
5+
<TargetFramework>net6.0</TargetFramework>
6+
<ImplicitUsings>enable</ImplicitUsings>
7+
<Nullable>enable</Nullable>
8+
</PropertyGroup>
9+
10+
</Project>
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import os
2+
from create_database_utils import *
3+
4+
run_codeql_database_create(['dotnet pack'], test_db="default-db", db=None, lang="csharp")
5+
6+
## Check that the NuGet package is created.
7+
if not os.path.isfile("bin/Debug/dotnet_pack.1.0.0.nupkg"):
8+
raise Exception("The NuGet package was not created.")
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
// See https://aka.ms/new-console-template for more information
2+
Console.WriteLine("Hello, World!");
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<OutputType>Exe</OutputType>
5+
<TargetFramework>net6.0</TargetFramework>
6+
<ImplicitUsings>enable</ImplicitUsings>
7+
<Nullable>enable</Nullable>
8+
</PropertyGroup>
9+
10+
</Project>
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import os
2+
from create_database_utils import *
3+
4+
run_codeql_database_create(['dotnet publish'], test_db="default-db", db=None, lang="csharp")
5+
6+
## Check that the publish folder is created.
7+
if not os.path.isdir("bin/Debug/net6.0/publish/"):
8+
raise Exception("The publish artifact folder was not created.")
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
using NUnit.Framework;
2+
3+
namespace dotnet_test;
4+
5+
public class Tests
6+
{
7+
[SetUp]
8+
public void Setup()
9+
{
10+
}
11+
12+
[Test]
13+
public void Test1()
14+
{
15+
Assert.Pass();
16+
}
17+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<TargetFramework>net6.0</TargetFramework>
5+
<Nullable>enable</Nullable>
6+
7+
<IsPackable>false</IsPackable>
8+
</PropertyGroup>
9+
10+
<ItemGroup>
11+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.11.0" />
12+
<PackageReference Include="NUnit" Version="3.13.2" />
13+
<PackageReference Include="NUnit3TestAdapter" Version="4.0.0" />
14+
<PackageReference Include="coverlet.collector" Version="3.1.0" />
15+
</ItemGroup>
16+
17+
</Project>
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
from create_database_utils import *
2+
3+
run_codeql_database_create(['dotnet test'], test_db="default-db", db=None, lang="csharp")

0 commit comments

Comments
 (0)