Skip to content

Commit ffb818a

Browse files
committed
Switch .NET Core 3.1 TFM in tests to .NET 7
1 parent 23245df commit ffb818a

File tree

24 files changed

+33
-35
lines changed

24 files changed

+33
-35
lines changed

tests/CommunityToolkit.Common.UnitTests/CommunityToolkit.Common.UnitTests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>net472;netcoreapp3.1;net6.0</TargetFrameworks>
4+
<TargetFrameworks>net472;net6.0;net7.0</TargetFrameworks>
55
</PropertyGroup>
66

77
<ItemGroup>

tests/CommunityToolkit.Diagnostics.UnitTests/CommunityToolkit.Diagnostics.UnitTests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>net472;netcoreapp3.1;net6.0</TargetFrameworks>
4+
<TargetFrameworks>net472;net6.0;net7.0</TargetFrameworks>
55
</PropertyGroup>
66

77
<ItemGroup>

tests/CommunityToolkit.HighPerformance.UnitTests/Buffers/Test_StringPool.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ public void Test_StringPool_GetOrAdd_ReadOnlySpan_Misc()
217217
Assert.AreEqual(nameof(helloworld), helloworld);
218218
Assert.AreEqual(nameof(dotnetCommunityToolkit), dotnetCommunityToolkit);
219219

220-
#if NETCOREAPP
220+
#if NET6_0_OR_GREATER
221221

222222
// .NET Framework reuses strings in a way that makes these tests fail.
223223
// The actual underlying APIs are still working as expected though.

tests/CommunityToolkit.HighPerformance.UnitTests/CommunityToolkit.HighPerformance.UnitTests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>net472;netcoreapp3.1;net6.0;net7.0</TargetFrameworks>
4+
<TargetFrameworks>net472;net6.0;net7.0</TargetFrameworks>
55
<EnablePreviewFeatures>true</EnablePreviewFeatures>
66
<NoWarn>$(NoWarn);CA2252</NoWarn>
77
</PropertyGroup>

tests/CommunityToolkit.HighPerformance.UnitTests/Enumerables/Test_ReadOnlyRefEnumerable{T}.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// The .NET Foundation licenses this file to you under the MIT license.
33
// See the LICENSE file in the project root for more information.
44

5-
#if NETCOREAPP
5+
#if NET6_0_OR_GREATER
66

77
using System;
88
using System.Runtime.CompilerServices;
@@ -81,7 +81,7 @@ public void Test_ReadOnlyRefEnumerable_Indexer_ThrowsIndexOutOfRange()
8181
_ = Assert.ThrowsException<IndexOutOfRangeException>(() => ReadOnlyRefEnumerable<int>.DangerousCreate(in array[0], array.Length, 1)[array.Length]);
8282
}
8383

84-
#if NETCOREAPP3_1_OR_GREATER
84+
#if NET6_0_OR_GREATER
8585
[TestMethod]
8686
[DataRow(1, new[] { 1 })]
8787
[DataRow(1, new[] { 1, 2, 3, 4 })]

tests/CommunityToolkit.HighPerformance.UnitTests/Enumerables/Test_RefEnumerable{T}.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// The .NET Foundation licenses this file to you under the MIT license.
33
// See the LICENSE file in the project root for more information.
44

5-
#if NETCOREAPP
5+
#if NET6_0_OR_GREATER
66

77
using System;
88
using System.Runtime.CompilerServices;
@@ -81,7 +81,7 @@ public void Test_RefEnumerable_Indexer_ThrowsIndexOutOfRange()
8181
_ = Assert.ThrowsException<IndexOutOfRangeException>(() => RefEnumerable<int>.DangerousCreate(ref array[0], array.Length, 1)[array.Length]);
8282
}
8383

84-
#if NETCOREAPP3_1_OR_GREATER
84+
#if NET6_0_OR_GREATER
8585
[TestMethod]
8686
[DataRow(1, new[] { 1 })]
8787
[DataRow(1, new[] { 1, 2, 3, 4 })]

tests/CommunityToolkit.HighPerformance.UnitTests/Extensions/Test_ArrayExtensions.2D.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,7 @@ public void Test_ArrayExtensions_2D_GetColumn_Empty()
419419
_ = Assert.ThrowsException<ArgumentOutOfRangeException>(() => array.GetColumn(0).ToArray());
420420
}
421421

422-
#if NETCOREAPP3_1_OR_GREATER
422+
#if NET6_0_OR_GREATER
423423
[TestMethod]
424424
public void Test_ArrayExtensions_2D_AsSpan_Empty()
425425
{

tests/CommunityToolkit.HighPerformance.UnitTests/Extensions/Test_IBufferWriterExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// See the LICENSE file in the project root for more information.
44

55
using System;
6-
#if NETCOREAPP
6+
#if NET6_0_OR_GREATER
77
using System.Buffers;
88
#endif
99
using System.IO;

tests/CommunityToolkit.HighPerformance.UnitTests/Helpers/Internals/Test_RuntimeHelpers.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// The .NET Foundation licenses this file to you under the MIT license.
33
// See the LICENSE file in the project root for more information.
44

5-
#if !NETCOREAPP3_1_OR_GREATER
5+
#if !NET6_0_OR_GREATER
66

77
using System;
88
using CommunityToolkit.HighPerformance.Helpers.Internals;

tests/CommunityToolkit.HighPerformance.UnitTests/Helpers/Test_HashCode{T}.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public void Test_HashCodeOfT_VectorUnsupportedTypes_TestRepeat()
5555
TestForType<char>();
5656
}
5757

58-
#if NETCOREAPP3_1_OR_GREATER
58+
#if NET6_0_OR_GREATER
5959
[TestMethod]
6060
public void Test_HashCodeOfT_ManagedType_TestRepeat()
6161
{

tests/CommunityToolkit.HighPerformance.UnitTests/Helpers/Test_ParallelHelper.For.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public unsafe void Test_ParallelHelper_ForWithIndices()
3838
}
3939
}
4040

41-
#if NETCOREAPP3_1_OR_GREATER
41+
#if NET6_0_OR_GREATER
4242
[TestMethod]
4343
[ExpectedException(typeof(ArgumentException))]
4444
public void Test_ParallelHelper_ForInvalidRange_FromEnd()

tests/CommunityToolkit.HighPerformance.UnitTests/Helpers/Test_ParallelHelper.For2D.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public unsafe void Test_ParallelHelper_For2DWithIndices()
5050
}
5151
}
5252

53-
#if NETCOREAPP3_1_OR_GREATER
53+
#if NET6_0_OR_GREATER
5454
[TestMethod]
5555
[ExpectedException(typeof(ArgumentException))]
5656
public void Test_ParallelHelper_For2DInvalidRange_FromEnd()

tests/CommunityToolkit.HighPerformance.UnitTests/Memory/Test_Memory2D{T}.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ public void Test_Memory2DT_Array3DConstructor_2()
194194
_ = Assert.ThrowsException<ArgumentOutOfRangeException>(() => new Memory2D<int>(array, 0, 0, 0, 3, 3));
195195
}
196196

197-
#if NETCOREAPP
197+
#if NET6_0_OR_GREATER
198198
[TestMethod]
199199
public void Test_Memory2DT_MemoryConstructor()
200200
{
@@ -352,7 +352,7 @@ public void Test_Memory2DT_TryGetMemory_2()
352352
Assert.AreEqual(memory.Span[2], 3);
353353
}
354354

355-
#if NETCOREAPP
355+
#if NET6_0_OR_GREATER
356356
[TestMethod]
357357
public void Test_Memory2DT_TryGetMemory_3()
358358
{

tests/CommunityToolkit.HighPerformance.UnitTests/Memory/Test_ReadOnlyMemory2D{T}.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ public void Test_ReadOnlyMemory2DT_Array3DConstructor_2()
174174
_ = Assert.ThrowsException<ArgumentOutOfRangeException>(() => new ReadOnlyMemory2D<int>(array, 0, 0, 0, 3, 3));
175175
}
176176

177-
#if NETCOREAPP
177+
#if NET6_0_OR_GREATER
178178
[TestMethod]
179179
public void Test_ReadOnlyMemory2DT_ReadOnlyMemoryConstructor()
180180
{
@@ -316,7 +316,7 @@ public void Test_ReadOnlyMemory2DT_TryGetReadOnlyMemory_2()
316316
Assert.AreEqual(memory.Span[2], 3);
317317
}
318318

319-
#if NETCOREAPP
319+
#if NET6_0_OR_GREATER
320320
[TestMethod]
321321
public void Test_ReadOnlyMemory2DT_TryGetReadOnlyMemory_3()
322322
{

tests/CommunityToolkit.HighPerformance.UnitTests/Memory/Test_ReadOnlySpan2D{T}.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public void Test_ReadOnlySpan2DT_Empty()
3535
Assert.AreEqual(empty2.Height, 0);
3636
}
3737

38-
#if NETCOREAPP
38+
#if NET6_0_OR_GREATER
3939
[TestMethod]
4040
public unsafe void Test_ReadOnlySpan2DT_RefConstructor()
4141
{
@@ -386,7 +386,7 @@ ref Unsafe.AsRef<int>(null),
386386
Assert.IsTrue(Unsafe.AreSame(ref r0, ref array[0, 0]));
387387
}
388388

389-
#if NETCOREAPP3_1_OR_GREATER
389+
#if NET6_0_OR_GREATER
390390
[TestMethod]
391391
public unsafe void Test_ReadOnlySpan2DT_Index_Indexer_1()
392392
{
@@ -535,7 +535,7 @@ public void Test_ReadOnlySpan2DT_Slice_2()
535535
Assert.AreEqual(slice3[0, 0], 5);
536536
}
537537

538-
#if NETCOREAPP
538+
#if NET6_0_OR_GREATER
539539
[TestMethod]
540540
public void Test_ReadOnlySpan2DT_GetRowReadOnlySpan()
541541
{

tests/CommunityToolkit.HighPerformance.UnitTests/Memory/Test_Span2D{T}.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public void Test_Span2DT_Empty()
4646
Assert.AreEqual(empty4.Height, 0);
4747
}
4848

49-
#if NETCOREAPP
49+
#if NET6_0_OR_GREATER
5050
[TestMethod]
5151
public unsafe void Test_Span2DT_RefConstructor()
5252
{
@@ -546,7 +546,7 @@ ref Unsafe.AsRef<int>(null),
546546
Assert.IsTrue(Unsafe.AreSame(ref r0, ref array[0, 0]));
547547
}
548548

549-
#if NETCOREAPP3_1_OR_GREATER
549+
#if NET6_0_OR_GREATER
550550
[TestMethod]
551551
public unsafe void Test_Span2DT_Index_Indexer_1()
552552
{
@@ -700,7 +700,7 @@ public void Test_Span2DT_Slice_2()
700700
Assert.AreEqual(slice3[0, 0], 5);
701701
}
702702

703-
#if NETCOREAPP
703+
#if NET6_0_OR_GREATER
704704
[TestMethod]
705705
public void Test_Span2DT_GetRowSpan()
706706
{

tests/CommunityToolkit.Mvvm.DisableINotifyPropertyChanging.UnitTests/CommunityToolkit.Mvvm.DisableINotifyPropertyChanging.UnitTests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>net472;netcoreapp3.1;net6.0</TargetFrameworks>
4+
<TargetFrameworks>net472;net6.0;net7.0</TargetFrameworks>
55
</PropertyGroup>
66

77
<ItemGroup>

tests/CommunityToolkit.Mvvm.Internals.UnitTests/CommunityToolkit.Mvvm.Internals.UnitTests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>net472;netcoreapp3.1;net6.0</TargetFrameworks>
4+
<TargetFrameworks>net472;net6.0;net7.0</TargetFrameworks>
55
</PropertyGroup>
66

77
<ItemGroup>

tests/CommunityToolkit.Mvvm.Internals.UnitTests/Test_Messenger.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ namespace CommunityToolkit.Mvvm.Internals.UnitTests;
1414
[TestClass]
1515
public partial class Test_Messenger
1616
{
17-
#if NETCOREAPP // Auto-trimming is disabled on .NET Framework
17+
#if NET6_0_OR_GREATER // Auto-trimming is disabled on .NET Framework
1818
[TestMethod]
1919
public void Test_WeakReferenceMessenger_AutoCleanup()
2020
{

tests/CommunityToolkit.Mvvm.Roslyn401.UnitTests/CommunityToolkit.Mvvm.Roslyn401.UnitTests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>net472;netcoreapp3.1;net6.0</TargetFrameworks>
4+
<TargetFrameworks>net472;net6.0;net7.0</TargetFrameworks>
55
<SuppressTfmSupportBuildWarnings>true</SuppressTfmSupportBuildWarnings>
66
</PropertyGroup>
77

tests/CommunityToolkit.Mvvm.Roslyn431.UnitTests/CommunityToolkit.Mvvm.Roslyn431.UnitTests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>net472;netcoreapp3.1;net6.0</TargetFrameworks>
4+
<TargetFrameworks>net472;net6.0;net7.0</TargetFrameworks>
55
<SuppressTfmSupportBuildWarnings>true</SuppressTfmSupportBuildWarnings>
66
</PropertyGroup>
77

tests/CommunityToolkit.Mvvm.SourceGenerators.Roslyn401.UnitTests/CommunityToolkit.Mvvm.SourceGenerators.Roslyn401.UnitTests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>net472;netcoreapp3.1;net6.0</TargetFrameworks>
4+
<TargetFrameworks>net472;net6.0;net7.0</TargetFrameworks>
55
</PropertyGroup>
66

77
<ItemGroup>

tests/CommunityToolkit.Mvvm.SourceGenerators.Roslyn431.UnitTests/CommunityToolkit.Mvvm.SourceGenerators.Roslyn431.UnitTests.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>net472;netcoreapp3.1;net6.0</TargetFrameworks>
4+
<TargetFrameworks>net472;net6.0;net7.0</TargetFrameworks>
55
</PropertyGroup>
66

77
<ItemGroup>

tests/CommunityToolkit.Mvvm.SourceGenerators.UnitTests/Helpers/CSharpAnalyzerWithLanguageVersionTest{TAnalyzer}.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,8 @@ public static Task VerifyAnalyzerAsync(string source, LanguageVersion languageVe
5050
{
5151
CSharpAnalyzerWithLanguageVersionTest<TAnalyzer> test = new(languageVersion) { TestCode = source };
5252

53-
#if NET6_0
53+
#if NET6_0_OR_GREATER
5454
test.TestState.ReferenceAssemblies = ReferenceAssemblies.Net.Net60;
55-
#elif NETCOREAPP3_1
56-
test.TestState.ReferenceAssemblies = ReferenceAssemblies.NetCore.NetCoreApp31;
5755
#else
5856
test.TestState.ReferenceAssemblies = ReferenceAssemblies.NetFramework.Net472.Default;
5957
test.TestState.AdditionalReferences.Add(MetadataReference.CreateFromFile(typeof(RequiredAttribute).Assembly.Location));

0 commit comments

Comments
 (0)