Skip to content

Commit 75f4216

Browse files
committed
Install NUnitLite to run .NET Core tests
1 parent 90a6d1a commit 75f4216

File tree

6 files changed

+49
-3
lines changed

6 files changed

+49
-3
lines changed

src/NHibernate.Test.VisualBasic/NHibernate.Test.VisualBasic.vbproj

+7-2
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,11 @@
1010
</PropertyGroup>
1111
<PropertyGroup Condition="'$(TargetFramework)' == 'netcoreapp2.0'">
1212
<DefineConstants>NETCOREAPP2_0,$(DefineConstants)</DefineConstants>
13+
<OutputType>Exe</OutputType>
14+
<GenerateProgramFile>false</GenerateProgramFile>
1315
</PropertyGroup>
1416
<PropertyGroup Condition="'$(TargetFramework)' == 'net461'">
15-
<DefineConstants>NETFX,NET461,$(DefineConstants)</DefineConstants>
17+
<DefineConstants>NET461,$(DefineConstants)</DefineConstants>
1618
</PropertyGroup>
1719
<ItemGroup>
1820
<None Remove="**\*.hbm.xml" />
@@ -29,11 +31,14 @@
2931
<ItemGroup>
3032
<PackageReference Include="Microsoft.VisualBasic" Version="10.2.0" />
3133
</ItemGroup>
34+
<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp2.0'">
35+
<PackageReference Include="NUnitLite" Version="3.9.0" />
36+
</ItemGroup>
3237
<ItemGroup>
3338
<ProjectReference Include="..\NHibernate\NHibernate.csproj" />
3439
<ProjectReference Include="..\NHibernate.Test\NHibernate.Test.csproj" ExcludeAssets="ContentFiles" />
3540
</ItemGroup>
3641
<ItemGroup>
3742
<Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}" />
3843
</ItemGroup>
39-
</Project>
44+
</Project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#If NETCOREAPP2_0
2+
Public Class Program
3+
Public Shared Function Main(args As String()) As Integer
4+
Return New NUnitLite.AutoRun(GetType(Program).Assembly).Execute(args)
5+
End Function
6+
End Class
7+
#End If

src/NHibernate.Test/NHibernate.Test.csproj

+4-1
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,17 @@
22
<Import Project="../../build-common/NHibernate.props" />
33
<PropertyGroup>
44
<Description>The Unit Tests for NHibernate.</Description>
5-
65
<TargetFrameworks>net461;netcoreapp2.0</TargetFrameworks>
76
<IsTestProject>true</IsTestProject>
87
<NoWarn>$(NoWarn);3001;3002;3003;3005</NoWarn>
98
</PropertyGroup>
109
<PropertyGroup Condition="'$(TargetFramework)' == 'net461'">
1110
<DefineConstants>NETFX;$(DefineConstants)</DefineConstants>
1211
</PropertyGroup>
12+
<PropertyGroup Condition="'$(TargetFramework)' == 'netcoreapp2.0'">
13+
<OutputType>Exe</OutputType>
14+
<GenerateProgramFile>false</GenerateProgramFile>
15+
</PropertyGroup>
1316
<ItemGroup>
1417
<None Remove="**\*.hbm.xml" />
1518
<None Remove="**\*.jpg" />

src/NHibernate.Test/Program.cs

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#if NETCOREAPP2_0
2+
namespace NHibernate.Test
3+
{
4+
public class Program
5+
{
6+
public static int Main(string[] args)
7+
{
8+
return new NUnitLite.AutoRun(typeof(Program).Assembly).Execute(args);
9+
}
10+
}
11+
}
12+
#endif

src/NHibernate.TestDatabaseSetup/NHibernate.TestDatabaseSetup.csproj

+7
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,16 @@
1010
<PropertyGroup Condition="'$(TargetFramework)' == 'net461'">
1111
<DefineConstants>NETFX;$(DefineConstants)</DefineConstants>
1212
</PropertyGroup>
13+
<PropertyGroup Condition="'$(TargetFramework)' == 'netcoreapp2.0'">
14+
<OutputType>Exe</OutputType>
15+
<GenerateProgramFile>false</GenerateProgramFile>
16+
</PropertyGroup>
1317
<ItemGroup>
1418
<ProjectReference Include="..\NHibernate.Test\NHibernate.Test.csproj" />
1519
</ItemGroup>
20+
<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp2.0'">
21+
<PackageReference Include="NUnitLite" Version="3.9.0" />
22+
</ItemGroup>
1623
<ItemGroup>
1724
<Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}" />
1825
</ItemGroup>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#if NETCOREAPP2_0
2+
namespace NHibernate.TestDatabaseSetup
3+
{
4+
public class Program
5+
{
6+
public static int Main(string[] args)
7+
{
8+
return new NUnitLite.AutoRun(typeof(Program).Assembly).Execute(args);
9+
}
10+
}
11+
}
12+
#endif

0 commit comments

Comments
 (0)