Skip to content

Commit ca124f5

Browse files
committed
remove .net 5.0 targetted code from tests
1 parent d0d7fd6 commit ca124f5

File tree

14 files changed

+35
-53
lines changed

14 files changed

+35
-53
lines changed

tests/Smdn.Reflection.ReverseGenerating.ListApi.Core/Smdn.Reflection.ReverseGenerating.ListApi.Core.Tests.csproj

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ SPDX-License-Identifier: MIT
44
-->
55
<Project Sdk="Microsoft.NET.Sdk">
66
<PropertyGroup>
7-
<TargetFrameworks>net6.0;net5.0;netcoreapp3.1</TargetFrameworks>
7+
<TargetFrameworks>net6.0;netcoreapp3.1</TargetFrameworks>
88
<RootNamespace>Smdn.Reflection.ReverseGenerating.ListApi.Core</RootNamespace>
99
<NoWarn>CS2002;$(NoWarn)</NoWarn>
1010
</PropertyGroup>
@@ -35,9 +35,6 @@ SPDX-License-Identifier: MIT
3535
<MSBuild Projects="@(TestProjects)" Targets="$(_TestProjectBuildTargets)" Properties="Configuration=Release;TargetFramework=netstandard2.1">
3636
<Output TaskParameter="TargetOutputs" ItemName="TestAssembliesNetStandard21" />
3737
</MSBuild>
38-
<MSBuild Projects="@(TestProjects)" Targets="$(_TestProjectBuildTargets)" Properties="Configuration=Release;TargetFramework=net5.0" Condition="'$(RunningOnNet7PreviewSdk)' != 'true'">
39-
<Output TaskParameter="TargetOutputs" ItemName="TestAssembliesNet50" />
40-
</MSBuild>
4138
<MSBuild Projects="@(TestProjects)" Targets="$(_TestProjectBuildTargets)" Properties="Configuration=Release;TargetFramework=net6.0" Condition="'$(RunningOnNet7PreviewSdk)' != 'true'">
4239
<Output TaskParameter="TargetOutputs" ItemName="TestAssembliesNet60" />
4340
</MSBuild>
@@ -47,7 +44,6 @@ SPDX-License-Identifier: MIT
4744

4845
<ItemGroup>
4946
<TestAssemblies Include="@(TestAssembliesNetStandard21)" />
50-
<TestAssemblies Include="@(TestAssembliesNet50)" />
5147
<TestAssemblies Include="@(TestAssembliesNet60)" />
5248
<TestAssemblies Include="@(TestAssembliesNet70)" />
5349
</ItemGroup>

tests/Smdn.Reflection.ReverseGenerating.ListApi.Core/Smdn.Reflection.ReverseGenerating.ListApi/AssemblyLoader.cs

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,11 @@ public void Init()
3737
logger = services.BuildServiceProvider().GetService<ILoggerFactory>()?.CreateLogger("test");
3838
}
3939

40-
#if NETCOREAPP3_1_OR_GREATER
40+
#if NETCOREAPP3_1_OR_GREATER || NET6_0_OR_GREATER
4141
[TestCase(true, "netstandard2.1")]
4242
[TestCase(false, "netstandard2.1")]
4343
#endif
4444
#if !SDK_NET7_PREVIEW
45-
#if NET5_0_OR_GREATER
46-
[TestCase(true, "net5.0")]
47-
[TestCase(false, "net5.0")]
48-
#endif
4945
#if NET6_0_OR_GREATER
5046
[TestCase(true, "net6.0")]
5147
[TestCase(false, "net6.0")]
@@ -104,15 +100,11 @@ public void UsingAssembly(bool loadIntoReflectionOnlyContext, string targetFrame
104100
Assert.IsTrue(unloaded, nameof(unloaded));
105101
}
106102

107-
#if NETCOREAPP3_1_OR_GREATER
103+
#if NETCOREAPP3_1_OR_GREATER || NET6_0_OR_GREATER
108104
[TestCase(true, "netstandard2.1")]
109105
[TestCase(false, "netstandard2.1")]
110106
#endif
111107
#if !SDK_NET7_PREVIEW
112-
#if NET5_0_OR_GREATER
113-
[TestCase(true, "net5.0")]
114-
[TestCase(false, "net5.0")]
115-
#endif
116108
#if NET6_0_OR_GREATER
117109
[TestCase(true, "net6.0")]
118110
[TestCase(false, "net6.0")]

tests/Smdn.Reflection.ReverseGenerating.ListApi/Smdn.Reflection.ReverseGenerating.ListApi.Build/ProjectBuilder.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ public void Build_HasProjectReference()
108108
Assert.That(assemblyFiles[1].FullName, Does.EndWith("LibB.dll"));
109109
}
110110

111-
[TestCase("net5.0")]
111+
[TestCase("net6.0")]
112112
[TestCase("netstandard2.1")]
113113
public void Build_WithTargetFramework(string targetFramework)
114114
{

tests/Smdn.Reflection.ReverseGenerating.ListApi/Smdn.Reflection.ReverseGenerating.ListApi.Tests.csproj

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ SPDX-License-Identifier: MIT
2121
<_TestProjectBuildTargets>Restore;Build</_TestProjectBuildTargets>
2222
</PropertyGroup>
2323

24-
<MSBuild Projects="$(TestAssemblyRootDirectory)\Exe\Exe.csproj" Targets="$(_TestProjectBuildTargets)" Properties="Configuration=Release;TargetFramework=net5.0">
25-
<Output TaskParameter="TargetOutputs" ItemName="TestAssembliesExeNet50" />
24+
<MSBuild Projects="$(TestAssemblyRootDirectory)\Exe\Exe.csproj" Targets="$(_TestProjectBuildTargets)" Properties="Configuration=Release;TargetFramework=net6.0">
25+
<Output TaskParameter="TargetOutputs" ItemName="TestAssembliesExeNet60" />
2626
</MSBuild>
27-
<MSBuild Projects="$(TestAssemblyRootDirectory)\Lib\Lib.csproj" Targets="$(_TestProjectBuildTargets)" Properties="Configuration=Release;TargetFramework=net5.0">
28-
<Output TaskParameter="TargetOutputs" ItemName="TestAssembliesLibNet50" />
27+
<MSBuild Projects="$(TestAssemblyRootDirectory)\Lib\Lib.csproj" Targets="$(_TestProjectBuildTargets)" Properties="Configuration=Release;TargetFramework=net6.0">
28+
<Output TaskParameter="TargetOutputs" ItemName="TestAssembliesLibNet60" />
2929
</MSBuild>
3030

3131
<ItemGroup>
@@ -35,18 +35,14 @@ SPDX-License-Identifier: MIT
3535
<MSBuild Projects="@(TestProjects)" Targets="$(_TestProjectBuildTargets)" Properties="Configuration=Release;TargetFramework=netstandard2.1">
3636
<Output TaskParameter="TargetOutputs" ItemName="TestAssembliesNetStandard21" />
3737
</MSBuild>
38-
<MSBuild Projects="@(TestProjects)" Targets="$(_TestProjectBuildTargets)" Properties="Configuration=Release;TargetFramework=net5.0">
39-
<Output TaskParameter="TargetOutputs" ItemName="TestAssembliesNet50" />
40-
</MSBuild>
4138
<MSBuild Projects="@(TestProjects)" Targets="$(_TestProjectBuildTargets)" Properties="Configuration=Release;TargetFramework=net6.0">
4239
<Output TaskParameter="TargetOutputs" ItemName="TestAssembliesNet60" />
4340
</MSBuild>
4441

4542
<ItemGroup>
46-
<TestAssemblies Include="@(TestAssembliesExeNet50)" />
47-
<TestAssemblies Include="@(TestAssembliesLibNet50)" />
43+
<TestAssemblies Include="@(TestAssembliesExeNet60)" />
44+
<TestAssemblies Include="@(TestAssembliesLibNet60)" />
4845
<TestAssemblies Include="@(TestAssembliesNetStandard21)" />
49-
<TestAssemblies Include="@(TestAssembliesNet50)" />
5046
<TestAssemblies Include="@(TestAssembliesNet60)" />
5147
</ItemGroup>
5248

tests/Smdn.Reflection.ReverseGenerating.ListApi/Smdn.Reflection.ReverseGenerating.ListApi/RootCommandImplementation.GetInputAssemblyFiles.cs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,9 @@ public void Init()
3636
serviceProvider = services.BuildServiceProvider();
3737
}
3838

39-
[TestCase("Lib.dll", "net5.0")]
40-
[TestCase("Exe.dll", "net5.0")]
39+
[TestCase("Lib.dll", "net6.0")]
40+
[TestCase("Exe.dll", "net6.0")]
4141
[TestCase("LibA.dll", "netstandard2.1")]
42-
[TestCase("LibA.dll", "net5.0")]
4342
[TestCase("LibA.dll", "net6.0")]
4443
public void GetInputAssemblyFiles_File_Assembly(string filename, string targetFrameworkMoniker)
4544
{
@@ -130,7 +129,7 @@ public void GetInputAssemblyFiles_File_Proj_WithConfigurationOption(string optio
130129

131130
CollectionAssert.AreEquivalent(
132131
new[] {
133-
PathJoiner.Join(TestAssemblyInfo.RootDirectory.FullName, "LibA", "bin", configuration, "net5.0", "LibA.dll"),
132+
PathJoiner.Join(TestAssemblyInfo.RootDirectory.FullName, "LibA", "bin", configuration, "net6.0", "LibA.dll"),
134133
PathJoiner.Join(TestAssemblyInfo.RootDirectory.FullName, "LibA", "bin", configuration, "netstandard2.1", "LibA.dll"),
135134
},
136135
impl.GetInputAssemblyFiles(new[] { optionName, configuration, proj }).Select(f => f.FullName)
@@ -174,7 +173,7 @@ public void GetInputAssemblyFiles_File_Proj_WithRuntimeOption(string optionName,
174173

175174
CollectionAssert.AreEquivalent(
176175
new[] {
177-
PathJoiner.Join(TestAssemblyInfo.RootDirectory.FullName, "Exe", "bin", RootCommandImplementation.DefaultBuildConfiguration, "net5.0", runtime, expectedBuildOutputFileName),
176+
PathJoiner.Join(TestAssemblyInfo.RootDirectory.FullName, "Exe", "bin", RootCommandImplementation.DefaultBuildConfiguration, "net6.0", runtime, expectedBuildOutputFileName),
178177
},
179178
impl.GetInputAssemblyFiles(new[] { optionName, runtime, proj }).Select(f => f.FullName)
180179
);
@@ -193,7 +192,7 @@ public void GetInputAssemblyFiles_Directory_ProjLib()
193192

194193
CollectionAssert.AreEquivalent(
195194
new[] {
196-
PathJoiner.Join(TestAssemblyInfo.RootDirectory.FullName, "Lib", "bin", RootCommandImplementation.DefaultBuildConfiguration, "net5.0", "Lib.dll"),
195+
PathJoiner.Join(TestAssemblyInfo.RootDirectory.FullName, "Lib", "bin", RootCommandImplementation.DefaultBuildConfiguration, "net6.0", "Lib.dll"),
197196
},
198197
impl.GetInputAssemblyFiles(new[] { dirProj }).Select(f => f.FullName)
199198
);
@@ -213,7 +212,7 @@ public void GetInputAssemblyFiles_Directory_ProjExe()
213212

214213
CollectionAssert.AreEquivalent(
215214
new[] {
216-
PathJoiner.Join(TestAssemblyInfo.RootDirectory.FullName, "Exe", "bin", RootCommandImplementation.DefaultBuildConfiguration, "net5.0", expectedBuildOutputFileName),
215+
PathJoiner.Join(TestAssemblyInfo.RootDirectory.FullName, "Exe", "bin", RootCommandImplementation.DefaultBuildConfiguration, "net6.0", expectedBuildOutputFileName),
217216
},
218217
impl.GetInputAssemblyFiles(new[] { dirProj }).Select(f => f.FullName)
219218
);

tests/Smdn.Reflection.ReverseGenerating.ListApi/Smdn.Reflection.ReverseGenerating.ListApi/RootCommandImplementation.GetOutputFilePaths.cs

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,9 @@ public void Init()
3535

3636
static string GetCurrentDirectory() => TestContext.CurrentContext.WorkDirectory;
3737

38-
[TestCase("Lib.dll", "net5.0", "Lib-net5.0.apilist.cs")]
39-
[TestCase("Exe.dll", "net5.0", "Exe-net5.0.apilist.cs")]
38+
[TestCase("Lib.dll", "net6.0", "Lib-net6.0.apilist.cs")]
39+
[TestCase("Exe.dll", "net6.0", "Exe-net6.0.apilist.cs")]
4040
[TestCase("LibA.dll", "netstandard2.1", "LibA-netstandard2.1.apilist.cs")]
41-
[TestCase("LibA.dll", "net5.0", "LibA-net5.0.apilist.cs")]
4241
[TestCase("LibA.dll", "net6.0", "LibA-net6.0.apilist.cs")]
4342
public void GetOutputFilePaths(string filename, string targetFrameworkMoniker, string expectedOutputFileName)
4443
{
@@ -66,7 +65,7 @@ public void GetOutputFilePaths(string filename, string targetFrameworkMoniker, s
6665
public void GetOutputFilePaths_WithOutputDirectoryOption(string optionName, string outputDirectory)
6766
{
6867
var assemblyFile = new FileInfo(
69-
TestAssemblyInfo.TestAssemblyPaths.First(f => f.Contains("net5.0") && f.Contains("Lib.dll"))
68+
TestAssemblyInfo.TestAssemblyPaths.First(f => f.Contains("net6.0") && f.Contains("Lib.dll"))
7069
);
7170

7271
var impl = new RootCommandImplementation(serviceProvider);
@@ -76,7 +75,7 @@ public void GetOutputFilePaths_WithOutputDirectoryOption(string optionName, stri
7675
}).First();
7776

7877
Assert.AreEqual(
79-
"Lib-net5.0.apilist.cs",
78+
"Lib-net6.0.apilist.cs",
8079
Path.GetFileName(outputFilePath)
8180
);
8281
Assert.AreEqual(
@@ -95,7 +94,7 @@ public void GetOutputFilePaths_FromProjFile()
9594
}).First();
9695

9796
Assert.AreEqual(
98-
"Exe-net5.0.apilist.cs",
97+
"Exe-net6.0.apilist.cs",
9998
Path.GetFileName(outputFilePath)
10099
);
101100
Assert.AreEqual(
@@ -119,7 +118,7 @@ public void GetOutputFilePaths_FromProjFile_WithOutputDirectoryOption(string opt
119118
}).First();
120119

121120
Assert.AreEqual(
122-
"Exe-net5.0.apilist.cs",
121+
"Exe-net6.0.apilist.cs",
123122
Path.GetFileName(outputFilePath)
124123
);
125124
Assert.AreEqual(
@@ -147,7 +146,7 @@ public void GetOutputFilePaths_FromProjFile_WithConfigurationOption(string optio
147146
CollectionAssert.AreEquivalent(
148147
new[] {
149148
"LibA-netstandard2.1.apilist.cs",
150-
"LibA-net5.0.apilist.cs",
149+
"LibA-net6.0.apilist.cs",
151150
},
152151
outputFilePaths.Select(f => Path.GetFileName(f))
153152
);
@@ -156,9 +155,9 @@ public void GetOutputFilePaths_FromProjFile_WithConfigurationOption(string optio
156155
#endif
157156
}
158157

159-
[TestCase("-f", "net5.0")]
160-
[TestCase("-f", "net5.0")]
161-
[TestCase("--framework", "netstandard2.1")]
158+
[TestCase("-f", "net6.0")]
159+
[TestCase("-f", "netstandard2.1")]
160+
[TestCase("--framework", "net6.0")]
162161
[TestCase("--framework", "netstandard2.1")]
163162
public void GetOutputFilePaths_FromProjFile_WithTargetFrameworkOption(string optionName, string targetFramework)
164163
{
@@ -196,7 +195,7 @@ public void GetOutputFilePaths_FromProjFile_WithRuntimeOption(string optionName,
196195
CollectionAssert.AreEquivalent(
197196
new[] {
198197
"LibA-netstandard2.1.apilist.cs",
199-
"LibA-net5.0.apilist.cs",
198+
"LibA-net6.0.apilist.cs",
200199
},
201200
outputFilePaths.Select(f => Path.GetFileName(f))
202201
);

tests/test-assm/Exe/Exe.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
<PropertyGroup>
33
<OutputType>Exe</OutputType>
4-
<TargetFramework>net5.0</TargetFramework>
4+
<TargetFramework>net6.0</TargetFramework>
55
<LangVersion>latest</LangVersion>
66
</PropertyGroup>
77
</Project>

tests/test-assm/ExeFSharp/ExeFSharp.fsproj

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
<PropertyGroup>
33
<OutputType>Exe</OutputType>
4-
<TargetFramework>net5.0</TargetFramework>
4+
<TargetFramework>net6.0</TargetFramework>
55
</PropertyGroup>
66

77
<ItemGroup>

tests/test-assm/ExeVB/ExeVB.vbproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
33
<OutputType>Exe</OutputType>
4-
<TargetFramework>net5.0</TargetFramework>
4+
<TargetFramework>net6.0</TargetFramework>
55
</PropertyGroup>
66
</Project>

tests/test-assm/Lib/Lib.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<TargetFramework>net5.0</TargetFramework>
3+
<TargetFramework>net6.0</TargetFramework>
44
</PropertyGroup>
55
</Project>

0 commit comments

Comments
 (0)