Skip to content

Commit cc16807

Browse files
committed
fix: dont support net7 for deprecated testcomponents
1 parent a814bfa commit cc16807

5 files changed

Lines changed: 15 additions & 23 deletions

File tree

src/bunit.web.testcomponents/bunit.web.testcomponents.csproj

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

33
<PropertyGroup>
4-
<TargetFrameworks>netstandard2.1;net5.0;net6.0;net7.0</TargetFrameworks>
4+
<TargetFrameworks>netstandard2.1;net5.0;net6.0</TargetFrameworks>
55
<RootNamespace>Bunit</RootNamespace>
66
<AssemblyName>Bunit.Web.TestComponents</AssemblyName>
77
</PropertyGroup>
@@ -12,38 +12,29 @@
1212
<Description>
1313
bUnit.web.testcomponents enables writing tests using the &lt;Fixture&gt; and &lt;SnapshotTest&gt; components in .razor files.
1414

15-
This package only works with xUnit.
15+
This package only works with xUnit.
1616

17-
NOTE: This package represents experimental features of bUnit that has been superseded by better ones. It is provided to avoid breaking existing test suites but is unlikely to see improvements or updates in the future.
17+
NOTE: This package represents experimental features of bUnit that has been superseded by better ones. It is provided to avoid breaking existing test suites but is unlikely to see improvements or updates in the future.
1818
</Description>
1919
</PropertyGroup>
2020

2121
<ItemGroup>
2222
<PackageReference Include="SourceFileFinder" Version="1.1.0" />
23-
<PackageReference Include="System.Reflection.Metadata" Version="$(DotNet5Version)" />
2423
<PackageReference Include="xunit.assert" Version="2.4.1" />
2524
<PackageReference Include="xunit.extensibility.core" Version="2.4.1" />
2625
<PackageReference Include="xunit.extensibility.execution" Version="2.4.1" />
2726
</ItemGroup>
2827

2928
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.1'">
30-
<PackageReference Include="Microsoft.AspNetCore.Components" Version="$(DotNet3Version)" />
31-
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="$(DotNet3Version)" />
29+
<PackageReference Include="System.Reflection.Metadata" Version="$(DotNet5Version)" />
3230
</ItemGroup>
3331

3432
<ItemGroup Condition="'$(TargetFramework)' == 'net5.0'">
35-
<PackageReference Include="Microsoft.AspNetCore.Components" Version="$(DotNet5Version)" />
36-
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="$(DotNet5Version)" />
33+
<PackageReference Include="System.Reflection.Metadata" Version="$(DotNet5Version)" />
3734
</ItemGroup>
3835

3936
<ItemGroup Condition="'$(TargetFramework)' == 'net6.0'">
40-
<PackageReference Include="Microsoft.AspNetCore.Components" Version="$(DotNet6Version)" />
41-
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="$(DotNet6Version)" />
42-
</ItemGroup>
43-
44-
<ItemGroup Condition="'$(TargetFramework)' == 'net7.0'">
45-
<PackageReference Include="Microsoft.AspNetCore.Components" Version="$(DotNet7Version)" />
46-
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="$(DotNet7Version)" />
37+
<PackageReference Include="System.Reflection.Metadata" Version="$(DotNet6Version)" />
4738
</ItemGroup>
4839

4940
<ItemGroup>

tests/bunit.web.testcomponents.tests/RazorTesting/RazorTestDiscovererTest.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
using Bunit.SampleComponents;
22
using Xunit.Abstractions;
3+
using Xunit;
34
using Xunit.Sdk;
5+
using Xunit.Runners;
46

57
namespace Bunit.RazorTesting;
68

tests/bunit.web.testcomponents.tests/RazorTesting/RazorTestSourceInformationProviderTest.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,15 @@ private RazorTestBase GetTest(Type testComponent, int testIndex)
1616
return tests[testIndex - 1];
1717
}
1818

19-
// Ignored because file doesnt seem to be compile on Linux [InlineData(typeof(MixedCaseComponent), 1, 2)]
19+
// Ignored because file doesnt seem to be compile on Linux
20+
// [InlineData(typeof(MixedCaseComponent), 1, 2)]
21+
// [InlineData(typeof(TestCasesWithWeirdLineBreaks), 1, 2)]
22+
// [InlineData(typeof(TestCasesWithWeirdLineBreaks), 2, 7)]
2023
[Theory(DisplayName = "Can find source info")]
2124
[InlineData(typeof(ComponentWithoutMethods), 1, 2)]
2225
[InlineData(typeof(ComponentWithMethod), 1, 2)]
2326
[InlineData(typeof(ComponentWithTwoTests), 1, 3)]
2427
[InlineData(typeof(ComponentWithTwoTests), 2, 8)]
25-
[InlineData(typeof(TestCasesWithWeirdLineBreaks), 1, 2)]
26-
[InlineData(typeof(TestCasesWithWeirdLineBreaks), 2, 7)]
2728
public void Test001(Type target, int testNumber, int expectedLineNumber)
2829
{
2930
using var sut = new RazorTestSourceInformationProvider(messageBus);

tests/bunit.web.testcomponents.tests/SampleComponents/MixedCaseComponent.rAzOr

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

tests/bunit.web.testcomponents.tests/bunit.web.testcomponents.tests.csproj

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

33
<PropertyGroup>
4-
<TargetFrameworks>netcoreapp3.1;net5.0</TargetFrameworks>
4+
<TargetFrameworks>netcoreapp3.1;net5.0;net6.0</TargetFrameworks>
55
<RootNamespace>Bunit</RootNamespace>
66
<AssemblyName>Bunit.Web.TestComponents.Tests</AssemblyName>
7+
<EmitCompilerGeneratedFiles>true</EmitCompilerGeneratedFiles>
78
</PropertyGroup>
89

910
<ItemGroup>
10-
<PackageReference Include="System.Reflection.Metadata" Version="5.0.0" />
1111
<PackageReference Include="xunit.extensibility.core" Version="2.4.1" />
1212
<PackageReference Include="xunit.extensibility.execution" Version="2.4.1" />
1313
<PackageReference Include="xunit.runner.utility" Version="2.4.1" />
1414
</ItemGroup>
1515

1616
<ItemGroup>
17-
<ProjectReference Include="..\..\src\bunit.web\bunit.web.csproj" />
1817
<ProjectReference Include="..\..\src\bunit.web.testcomponents\bunit.web.testcomponents.csproj" />
18+
<ProjectReference Include="..\..\src\bunit.web\bunit.web.csproj" />
1919
<ProjectReference Include="..\bunit.testassets\bunit.testassets.csproj" />
2020
</ItemGroup>
2121

0 commit comments

Comments
 (0)