Skip to content

Commit abc5a8e

Browse files
committed
test: Run tests using .NET 6
1 parent 2446d5b commit abc5a8e

File tree

6 files changed

+11
-31
lines changed

6 files changed

+11
-31
lines changed

src/NHibernate.Mapping.Attributes.Test/Baz.CoreReference.hbm.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@
119119
<property name="Count" type="Int32" column="count_" />
120120
</composite-element>
121121
</list>
122-
<list name="ManyToAny" lazy="true" collection-type="System.Collections.ArrayList, System.Runtime.Extensions">
122+
<list name="ManyToAny" lazy="true" collection-type="Collections.ArrayList">
123123
<key column="baz" />
124124
<index column="ind" />
125125
<many-to-any id-type="String">

src/NHibernate.Mapping.Attributes.Test/DomainModel.CoreReference.hbm.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@
121121
<property name="Count" type="Int32" column="count_" />
122122
</composite-element>
123123
</list>
124-
<list name="ManyToAny" lazy="true" collection-type="System.Collections.ArrayList, System.Runtime.Extensions">
124+
<list name="ManyToAny" lazy="true" collection-type="Collections.ArrayList">
125125
<key column="baz" />
126126
<index column="ind" />
127127
<many-to-any id-type="String">

src/NHibernate.Mapping.Attributes.Test/NHibernate.Mapping.Attributes.Test.csproj

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
<PropertyGroup>
55
<Product>NHibernate.Mapping.Attributes.Generator</Product>
66
<Description>Unit tests of NHibernate.Mapping.Attributes</Description>
7-
<TargetFrameworks>netcoreapp2.0;net461</TargetFrameworks>
7+
<TargetFrameworks>net6.0;net461</TargetFrameworks>
88
<IsTestProject>true</IsTestProject>
99
</PropertyGroup>
1010
<PropertyGroup Condition="'$(TargetFramework)' == 'net461'">
1111
<DefineConstants>NETFX;$(DefineConstants)</DefineConstants>
1212
</PropertyGroup>
13-
<PropertyGroup Condition="'$(TargetFramework)' == 'netcoreapp2.0'">
13+
<PropertyGroup Condition="'$(TargetFramework)' == 'net6.0'">
1414
<OutputType>Exe</OutputType>
1515
<GenerateProgramFile>false</GenerateProgramFile>
1616
</PropertyGroup>
@@ -36,14 +36,14 @@
3636
</ItemGroup>
3737

3838
<ItemGroup>
39-
<PackageReference Include="NUnit" Version="3.9.0" />
4039
<PackageReference Include="NUnit3TestAdapter" Version="3.9.0" />
4140
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.6.1" />
4241
<PackageReference Include="log4net" Version="2.0.15" />
4342
</ItemGroup>
44-
<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp2.0'">
45-
<PackageReference Include="System.Data.Common" Version="4.3.0" />
46-
<PackageReference Include="System.Collections" Version="4.3.0" />
43+
<ItemGroup Condition="'$(TargetFramework)' == 'net461'">
44+
<PackageReference Include="NUnit" Version="3.9.0" />
45+
</ItemGroup>
46+
<ItemGroup Condition="'$(TargetFramework)' == 'net6.0'">
4747
<PackageReference Include="NUnitLite" Version="3.9.0" />
4848
</ItemGroup>
4949
</Project>

src/NHibernate.Mapping.Attributes.Test/NHibernate.Mapping.Attributes.Test.nunit

Lines changed: 0 additions & 9 deletions
This file was deleted.

src/NHibernate.Mapping.Attributes.Test/Program.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#if NETCOREAPP2_0
1+
#if !NETFX
22
namespace NHibernate.Mapping.Attributes.Test
33
{
44
public class Program

src/NHibernate.Mapping.Attributes.Test/SerializationFixture.cs

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,9 @@ public void TestSerialization()
4242
HbmSerializer.Default.Error.Remove(0, HbmSerializer.Default.Error.Length);
4343

4444
// Generate (baz & assembly) + Validate
45-
Stream bazStream = null;
46-
Stream assemblyStream = null;
47-
try
45+
using (var bazStream = SerializeBaz())
46+
using (var assemblyStream = SerializeAssembly())
4847
{
49-
bazStream = SerializeBaz();
50-
assemblyStream = SerializeAssembly();
51-
5248
// Throw if errors
5349
if (HbmSerializer.Default.Validate && HbmSerializer.Default.Error.Length > 0)
5450
throw new Exception(HbmSerializer.Default.Error.ToString());
@@ -62,13 +58,6 @@ public void TestSerialization()
6258
Compare(assemblyStream, "DomainModel.CoreReference.hbm.xml");
6359
#endif
6460
}
65-
finally
66-
{
67-
if (bazStream != null)
68-
bazStream.Close();
69-
if (assemblyStream != null)
70-
assemblyStream.Close();
71-
}
7261
}
7362

7463

0 commit comments

Comments
 (0)