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
4 changed files
with
45 additions
and
11 deletions.
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 | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,33 @@ | |||
using System; | |||
using System.Collections.Generic; | |||
using Xunit; | |||
using Xunit.Sdk; | |||
|
|||
namespace Sep.Git.Tfs.Test | |||
{ | |||
public class FactExceptOnUnixAttribute : FactAttribute | |||
{ | |||
protected override IEnumerable<ITestCommand> EnumerateTestCommands(IMethodInfo method) | |||
{ | |||
yield return new FactExceptOnUnixTestCommand(method); | |||
} | |||
|
|||
class FactExceptOnUnixTestCommand : FactCommand | |||
{ | |||
public FactExceptOnUnixTestCommand(IMethodInfo method) : base(method) { } | |||
|
|||
public override MethodResult Execute(object testClass) | |||
{ | |||
if(IsUnix()) | |||
return new SkipResult(testMethod, DisplayName, "This test does not work on unix-like OSes yet."); | |||
|
|||
return base.Execute(testClass); | |||
} | |||
|
|||
private bool IsUnix() | |||
{ | |||
return Environment.OSVersion.Platform == PlatformID.Unix || Environment.OSVersion.Platform == PlatformID.MacOSX; | |||
} | |||
} | |||
} | |||
} |
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
28a199a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🍺