Skip to content

Commit 51a4ba2

Browse files
committed
Install NUnitLite to run .NET Core tests
1 parent ea10c46 commit 51a4ba2

File tree

6 files changed

+55
-2
lines changed

6 files changed

+55
-2
lines changed

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

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,14 @@
88
<OptionExplicit>On</OptionExplicit>
99
<OptionStrict>On</OptionStrict>
1010
</PropertyGroup>
11+
<PropertyGroup Condition="'$(TargetFramework)' == 'netcoreapp2.0'">
12+
<DefineConstants>NETCOREAPP2_0,$(DefineConstants)</DefineConstants>
13+
<OutputType>Exe</OutputType>
14+
<GenerateProgramFile>false</GenerateProgramFile>
15+
</PropertyGroup>
16+
<PropertyGroup Condition="'$(TargetFramework)' == 'net461'">
17+
<DefineConstants>NET461,$(DefineConstants)</DefineConstants>
18+
</PropertyGroup>
1119
<ItemGroup>
1220
<None Remove="**\*.hbm.xml" />
1321
</ItemGroup>
@@ -23,11 +31,14 @@
2331
<ItemGroup>
2432
<PackageReference Include="Microsoft.VisualBasic" Version="10.2.0" />
2533
</ItemGroup>
34+
<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp2.0'">
35+
<PackageReference Include="NUnitLite" Version="3.9.0" />
36+
</ItemGroup>
2637
<ItemGroup>
2738
<ProjectReference Include="..\NHibernate\NHibernate.csproj" />
2839
<ProjectReference Include="..\NHibernate.Test\NHibernate.Test.csproj" ExcludeAssets="ContentFiles" />
2940
</ItemGroup>
3041
<ItemGroup>
3142
<Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}" />
3243
</ItemGroup>
33-
</Project>
44+
</Project>
Lines changed: 7 additions & 0 deletions
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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,14 @@
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>
9+
<PropertyGroup Condition="'$(TargetFramework)' == 'netcoreapp2.0'">
10+
<OutputType>Exe</OutputType>
11+
<GenerateProgramFile>false</GenerateProgramFile>
12+
</PropertyGroup>
1013
<ItemGroup>
1114
<None Remove="**\*.hbm.xml" />
1215
<None Remove="**\*.jpg" />
@@ -69,6 +72,7 @@
6972
<PackageReference Include="System.Data.OracleClient" Version="1.0.8" />
7073
<PackageReference Include="System.Data.Odbc" Version="4.5.0-preview1-25914-04" />
7174
<PackageReference Include="System.Net.NameResolution" Version="4.3.0" />
75+
<PackageReference Include="NUnitLite" Version="3.9.0" />
7276
</ItemGroup>
7377
<ItemGroup Condition=" '$(NuGetPackageRoot)' != '' ">
7478
<NativeBinaries Include="$(NuGetPackageRoot)microsoft.sqlserver.compact\4.0.8876.1\NativeBinaries\**\*.*" />

src/NHibernate.Test/Program.cs

Lines changed: 12 additions & 0 deletions
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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,16 @@
77
<IsTestProject>true</IsTestProject>
88
<NoWarn>$(NoWarn);3001;3002;3003;3005</NoWarn>
99
</PropertyGroup>
10+
<PropertyGroup Condition="'$(TargetFramework)' == 'netcoreapp2.0'">
11+
<OutputType>Exe</OutputType>
12+
<GenerateProgramFile>false</GenerateProgramFile>
13+
</PropertyGroup>
1014
<ItemGroup>
1115
<ProjectReference Include="..\NHibernate.Test\NHibernate.Test.csproj" />
1216
</ItemGroup>
17+
<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp2.0'">
18+
<PackageReference Include="NUnitLite" Version="3.9.0" />
19+
</ItemGroup>
1320
<ItemGroup>
1421
<Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}" />
1522
</ItemGroup>
Lines changed: 12 additions & 0 deletions
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)