Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Switch .NET Core 3.1 TFM in tests to .NET 7
  • Loading branch information
Sergio0694 committed Nov 16, 2022
commit ffb818aa153a036c0bcfce35ffb3bc27ed4272bf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net472;netcoreapp3.1;net6.0</TargetFrameworks>
<TargetFrameworks>net472;net6.0;net7.0</TargetFrameworks>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net472;netcoreapp3.1;net6.0</TargetFrameworks>
<TargetFrameworks>net472;net6.0;net7.0</TargetFrameworks>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ public void Test_StringPool_GetOrAdd_ReadOnlySpan_Misc()
Assert.AreEqual(nameof(helloworld), helloworld);
Assert.AreEqual(nameof(dotnetCommunityToolkit), dotnetCommunityToolkit);

#if NETCOREAPP
#if NET6_0_OR_GREATER

// .NET Framework reuses strings in a way that makes these tests fail.
// The actual underlying APIs are still working as expected though.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net472;netcoreapp3.1;net6.0;net7.0</TargetFrameworks>
<TargetFrameworks>net472;net6.0;net7.0</TargetFrameworks>
<EnablePreviewFeatures>true</EnablePreviewFeatures>
<NoWarn>$(NoWarn);CA2252</NoWarn>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

#if NETCOREAPP
#if NET6_0_OR_GREATER

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

#if NETCOREAPP3_1_OR_GREATER
#if NET6_0_OR_GREATER
[TestMethod]
[DataRow(1, new[] { 1 })]
[DataRow(1, new[] { 1, 2, 3, 4 })]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

#if NETCOREAPP
#if NET6_0_OR_GREATER

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

#if NETCOREAPP3_1_OR_GREATER
#if NET6_0_OR_GREATER
[TestMethod]
[DataRow(1, new[] { 1 })]
[DataRow(1, new[] { 1, 2, 3, 4 })]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ public void Test_ArrayExtensions_2D_GetColumn_Empty()
_ = Assert.ThrowsException<ArgumentOutOfRangeException>(() => array.GetColumn(0).ToArray());
}

#if NETCOREAPP3_1_OR_GREATER
#if NET6_0_OR_GREATER
[TestMethod]
public void Test_ArrayExtensions_2D_AsSpan_Empty()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// See the LICENSE file in the project root for more information.

using System;
#if NETCOREAPP
#if NET6_0_OR_GREATER
using System.Buffers;
#endif
using System.IO;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

#if !NETCOREAPP3_1_OR_GREATER
#if !NET6_0_OR_GREATER

using System;
using CommunityToolkit.HighPerformance.Helpers.Internals;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public void Test_HashCodeOfT_VectorUnsupportedTypes_TestRepeat()
TestForType<char>();
}

#if NETCOREAPP3_1_OR_GREATER
#if NET6_0_OR_GREATER
[TestMethod]
public void Test_HashCodeOfT_ManagedType_TestRepeat()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public unsafe void Test_ParallelHelper_ForWithIndices()
}
}

#if NETCOREAPP3_1_OR_GREATER
#if NET6_0_OR_GREATER
[TestMethod]
[ExpectedException(typeof(ArgumentException))]
public void Test_ParallelHelper_ForInvalidRange_FromEnd()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public unsafe void Test_ParallelHelper_For2DWithIndices()
}
}

#if NETCOREAPP3_1_OR_GREATER
#if NET6_0_OR_GREATER
[TestMethod]
[ExpectedException(typeof(ArgumentException))]
public void Test_ParallelHelper_For2DInvalidRange_FromEnd()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ public void Test_Memory2DT_Array3DConstructor_2()
_ = Assert.ThrowsException<ArgumentOutOfRangeException>(() => new Memory2D<int>(array, 0, 0, 0, 3, 3));
}

#if NETCOREAPP
#if NET6_0_OR_GREATER
[TestMethod]
public void Test_Memory2DT_MemoryConstructor()
{
Expand Down Expand Up @@ -352,7 +352,7 @@ public void Test_Memory2DT_TryGetMemory_2()
Assert.AreEqual(memory.Span[2], 3);
}

#if NETCOREAPP
#if NET6_0_OR_GREATER
[TestMethod]
public void Test_Memory2DT_TryGetMemory_3()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ public void Test_ReadOnlyMemory2DT_Array3DConstructor_2()
_ = Assert.ThrowsException<ArgumentOutOfRangeException>(() => new ReadOnlyMemory2D<int>(array, 0, 0, 0, 3, 3));
}

#if NETCOREAPP
#if NET6_0_OR_GREATER
[TestMethod]
public void Test_ReadOnlyMemory2DT_ReadOnlyMemoryConstructor()
{
Expand Down Expand Up @@ -316,7 +316,7 @@ public void Test_ReadOnlyMemory2DT_TryGetReadOnlyMemory_2()
Assert.AreEqual(memory.Span[2], 3);
}

#if NETCOREAPP
#if NET6_0_OR_GREATER
[TestMethod]
public void Test_ReadOnlyMemory2DT_TryGetReadOnlyMemory_3()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public void Test_ReadOnlySpan2DT_Empty()
Assert.AreEqual(empty2.Height, 0);
}

#if NETCOREAPP
#if NET6_0_OR_GREATER
[TestMethod]
public unsafe void Test_ReadOnlySpan2DT_RefConstructor()
{
Expand Down Expand Up @@ -386,7 +386,7 @@ ref Unsafe.AsRef<int>(null),
Assert.IsTrue(Unsafe.AreSame(ref r0, ref array[0, 0]));
}

#if NETCOREAPP3_1_OR_GREATER
#if NET6_0_OR_GREATER
[TestMethod]
public unsafe void Test_ReadOnlySpan2DT_Index_Indexer_1()
{
Expand Down Expand Up @@ -535,7 +535,7 @@ public void Test_ReadOnlySpan2DT_Slice_2()
Assert.AreEqual(slice3[0, 0], 5);
}

#if NETCOREAPP
#if NET6_0_OR_GREATER
[TestMethod]
public void Test_ReadOnlySpan2DT_GetRowReadOnlySpan()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public void Test_Span2DT_Empty()
Assert.AreEqual(empty4.Height, 0);
}

#if NETCOREAPP
#if NET6_0_OR_GREATER
[TestMethod]
public unsafe void Test_Span2DT_RefConstructor()
{
Expand Down Expand Up @@ -546,7 +546,7 @@ ref Unsafe.AsRef<int>(null),
Assert.IsTrue(Unsafe.AreSame(ref r0, ref array[0, 0]));
}

#if NETCOREAPP3_1_OR_GREATER
#if NET6_0_OR_GREATER
[TestMethod]
public unsafe void Test_Span2DT_Index_Indexer_1()
{
Expand Down Expand Up @@ -700,7 +700,7 @@ public void Test_Span2DT_Slice_2()
Assert.AreEqual(slice3[0, 0], 5);
}

#if NETCOREAPP
#if NET6_0_OR_GREATER
[TestMethod]
public void Test_Span2DT_GetRowSpan()
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net472;netcoreapp3.1;net6.0</TargetFrameworks>
<TargetFrameworks>net472;net6.0;net7.0</TargetFrameworks>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net472;netcoreapp3.1;net6.0</TargetFrameworks>
<TargetFrameworks>net472;net6.0;net7.0</TargetFrameworks>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ namespace CommunityToolkit.Mvvm.Internals.UnitTests;
[TestClass]
public partial class Test_Messenger
{
#if NETCOREAPP // Auto-trimming is disabled on .NET Framework
#if NET6_0_OR_GREATER // Auto-trimming is disabled on .NET Framework
[TestMethod]
public void Test_WeakReferenceMessenger_AutoCleanup()
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net472;netcoreapp3.1;net6.0</TargetFrameworks>
<TargetFrameworks>net472;net6.0;net7.0</TargetFrameworks>
<SuppressTfmSupportBuildWarnings>true</SuppressTfmSupportBuildWarnings>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net472;netcoreapp3.1;net6.0</TargetFrameworks>
<TargetFrameworks>net472;net6.0;net7.0</TargetFrameworks>
<SuppressTfmSupportBuildWarnings>true</SuppressTfmSupportBuildWarnings>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net472;netcoreapp3.1;net6.0</TargetFrameworks>
<TargetFrameworks>net472;net6.0;net7.0</TargetFrameworks>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net472;netcoreapp3.1;net6.0</TargetFrameworks>
<TargetFrameworks>net472;net6.0;net7.0</TargetFrameworks>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,8 @@ public static Task VerifyAnalyzerAsync(string source, LanguageVersion languageVe
{
CSharpAnalyzerWithLanguageVersionTest<TAnalyzer> test = new(languageVersion) { TestCode = source };

#if NET6_0
#if NET6_0_OR_GREATER
test.TestState.ReferenceAssemblies = ReferenceAssemblies.Net.Net60;
#elif NETCOREAPP3_1
test.TestState.ReferenceAssemblies = ReferenceAssemblies.NetCore.NetCoreApp31;
#else
test.TestState.ReferenceAssemblies = ReferenceAssemblies.NetFramework.Net472.Default;
test.TestState.AdditionalReferences.Add(MetadataReference.CreateFromFile(typeof(RequiredAttribute).Assembly.Location));
Expand Down