forked from AArnott/Xunit.SkippableFact
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
62 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>net9.0</TargetFramework> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
<Nullable>enable</Nullable> | ||
<IsPackable>false</IsPackable> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Microsoft.NET.Test.Sdk" /> | ||
<PackageReference Include="xunit" /> | ||
<PackageReference Include="xunit.runner.visualstudio" PrivateAssets="all" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<Using Include="Xunit"/> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\..\src\Xunit.SkippableFact\Xunit.SkippableFact.csproj" /> | ||
</ItemGroup> | ||
|
||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// Copyright (c) Andrew Arnott. All rights reserved. | ||
// Licensed under the Microsoft Public License (Ms-PL). See LICENSE.txt file in the project root for full license information. | ||
|
||
using System.Diagnostics.CodeAnalysis; | ||
|
||
namespace Issue33; | ||
|
||
[SuppressMessage("Style", "IDE0028:Simplify collection initialization", Justification = "How the theory data is initialized is the point of this issue")] | ||
[SuppressMessage("ReSharper", "UseCollectionExpression", Justification = "How the theory data is initialized is the point of this issue")] | ||
public class Test | ||
{ | ||
public static TheoryData<IEnumerable<string>> WorkingData() => new() { Array.Empty<string>() }; | ||
|
||
public static TheoryData<IEnumerable<string>> FailingData() => new() { Enumerable.Empty<string>() }; | ||
|
||
[SkippableTheory] | ||
[MemberData(nameof(WorkingData))] | ||
public void WorkingTest(IEnumerable<string> ignored) | ||
{ | ||
_ = ignored; | ||
throw new SkipException(); | ||
} | ||
|
||
[SkippableTheory] | ||
[MemberData(nameof(FailingData))] | ||
public void FailingTest(IEnumerable<string> ignored) | ||
{ | ||
_ = ignored; | ||
throw new SkipException(); | ||
} | ||
} |