Skip to content

Commit d02cb06

Browse files
committed
Reproduction for issue AArnott#33
1 parent a16b833 commit d02cb06

File tree

3 files changed

+62
-1
lines changed

3 files changed

+62
-1
lines changed

Xunit.SkippableFact.sln

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Microsoft Visual Studio Solution File, Format Version 12.00
1+
Microsoft Visual Studio Solution File, Format Version 12.00
22
# Visual Studio 15
33
VisualStudioVersion = 15.0.26228.9
44
MinimumVisualStudioVersion = 10.0.40219.1
@@ -24,6 +24,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Xunit.SkippableFact.Tests",
2424
EndProject
2525
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Samples", "samples\Samples.csproj", "{115DBEC6-9D00-4070-82C3-C17D3F508EE0}"
2626
EndProject
27+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Issue33", "test\Issue33\Issue33.csproj", "{FEB438DC-E4A3-476C-A7A6-3F57CC88F2DF}"
28+
EndProject
2729
Global
2830
GlobalSection(SolutionConfigurationPlatforms) = preSolution
2931
Debug|Any CPU = Debug|Any CPU
@@ -42,6 +44,10 @@ Global
4244
{115DBEC6-9D00-4070-82C3-C17D3F508EE0}.Debug|Any CPU.Build.0 = Debug|Any CPU
4345
{115DBEC6-9D00-4070-82C3-C17D3F508EE0}.Release|Any CPU.ActiveCfg = Release|Any CPU
4446
{115DBEC6-9D00-4070-82C3-C17D3F508EE0}.Release|Any CPU.Build.0 = Release|Any CPU
47+
{FEB438DC-E4A3-476C-A7A6-3F57CC88F2DF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
48+
{FEB438DC-E4A3-476C-A7A6-3F57CC88F2DF}.Debug|Any CPU.Build.0 = Debug|Any CPU
49+
{FEB438DC-E4A3-476C-A7A6-3F57CC88F2DF}.Release|Any CPU.ActiveCfg = Release|Any CPU
50+
{FEB438DC-E4A3-476C-A7A6-3F57CC88F2DF}.Release|Any CPU.Build.0 = Release|Any CPU
4551
EndGlobalSection
4652
GlobalSection(SolutionProperties) = preSolution
4753
HideSolutionNode = FALSE

test/Issue33/Issue33.csproj

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<TargetFramework>net9.0</TargetFramework>
5+
<ImplicitUsings>enable</ImplicitUsings>
6+
<Nullable>enable</Nullable>
7+
<IsPackable>false</IsPackable>
8+
</PropertyGroup>
9+
10+
<ItemGroup>
11+
<PackageReference Include="Microsoft.NET.Test.Sdk" />
12+
<PackageReference Include="xunit" />
13+
<PackageReference Include="xunit.runner.visualstudio" PrivateAssets="all" />
14+
</ItemGroup>
15+
16+
<ItemGroup>
17+
<Using Include="Xunit"/>
18+
</ItemGroup>
19+
20+
<ItemGroup>
21+
<ProjectReference Include="..\..\src\Xunit.SkippableFact\Xunit.SkippableFact.csproj" />
22+
</ItemGroup>
23+
24+
</Project>

test/Issue33/Test.cs

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
// Copyright (c) Andrew Arnott. All rights reserved.
2+
// Licensed under the Microsoft Public License (Ms-PL). See LICENSE.txt file in the project root for full license information.
3+
4+
using System.Diagnostics.CodeAnalysis;
5+
6+
namespace Issue33;
7+
8+
[SuppressMessage("Style", "IDE0028:Simplify collection initialization", Justification = "How the theory data is initialized is the point of this issue")]
9+
[SuppressMessage("ReSharper", "UseCollectionExpression", Justification = "How the theory data is initialized is the point of this issue")]
10+
public class Test
11+
{
12+
public static TheoryData<IEnumerable<string>> WorkingData() => new() { Array.Empty<string>() };
13+
14+
public static TheoryData<IEnumerable<string>> FailingData() => new() { Enumerable.Empty<string>() };
15+
16+
[SkippableTheory]
17+
[MemberData(nameof(WorkingData))]
18+
public void WorkingTest(IEnumerable<string> ignored)
19+
{
20+
_ = ignored;
21+
throw new SkipException();
22+
}
23+
24+
[SkippableTheory]
25+
[MemberData(nameof(FailingData))]
26+
public void FailingTest(IEnumerable<string> ignored)
27+
{
28+
_ = ignored;
29+
throw new SkipException();
30+
}
31+
}

0 commit comments

Comments
 (0)