Skip to content

Commit

Permalink
Merge pull request #39 from AArnott/fixes
Browse files Browse the repository at this point in the history
Remove dead `#if` regions
  • Loading branch information
AArnott authored Oct 1, 2024
2 parents 0a2cdce + 90c26e5 commit d10db23
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 24 deletions.
4 changes: 0 additions & 4 deletions src/Xunit.SkippableFact/Sdk/SkippableFactDiscoverer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,6 @@ public virtual IEnumerable<IXunitTestCase> Discover(ITestFrameworkDiscoveryOptio
{
Requires.NotNull(factAttribute, nameof(factAttribute));
string[] skippingExceptionNames = GetSkippableExceptionNames(factAttribute);
#if NET45
yield return new SkippableFactTestCase(skippingExceptionNames, this.diagnosticMessageSink, discoveryOptions.MethodDisplayOrDefault(), testMethod);
#else
yield return new SkippableFactTestCase(skippingExceptionNames, this.diagnosticMessageSink, discoveryOptions.MethodDisplayOrDefault(), discoveryOptions.MethodDisplayOptionsOrDefault(), testMethod);
#endif
}
}
6 changes: 0 additions & 6 deletions src/Xunit.SkippableFact/Sdk/SkippableFactTestCase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,12 @@ public SkippableFactTestCase()
/// <param name="testMethod">The test method.</param>
/// <param name="testMethodArguments">The test method arguments.</param>
public SkippableFactTestCase(string[] skippingExceptionNames, IMessageSink diagnosticMessageSink, TestMethodDisplay defaultMethodDisplay, ITestMethod testMethod, object[]? testMethodArguments = null)
#if NET45
: base(diagnosticMessageSink, defaultMethodDisplay, testMethod, testMethodArguments)
#else
: base(diagnosticMessageSink, defaultMethodDisplay, TestMethodDisplayOptions.None, testMethod, testMethodArguments)
#endif
{
Requires.NotNull(skippingExceptionNames, nameof(skippingExceptionNames));
this.SkippingExceptionNames = skippingExceptionNames;
}

#if !NET45
/// <summary>
/// Initializes a new instance of the <see cref="SkippableFactTestCase"/> class.
/// </summary>
Expand All @@ -62,7 +57,6 @@ public SkippableFactTestCase(string[] skippingExceptionNames, IMessageSink diagn
Requires.NotNull(skippingExceptionNames, nameof(skippingExceptionNames));
this.SkippingExceptionNames = skippingExceptionNames;
}
#endif

/// <summary>
/// Gets an array of full names to exception types that should be interpreted as a skip result.
Expand Down
8 changes: 0 additions & 8 deletions src/Xunit.SkippableFact/Sdk/SkippableTheoryDiscoverer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,19 +48,11 @@ public virtual IEnumerable<IXunitTestCase> Discover(ITestFrameworkDiscoveryOptio
{
if (testCase is XunitTheoryTestCase)
{
#if NET45
yield return new SkippableTheoryTestCase(skippingExceptionNames, this.diagnosticMessageSink, defaultMethodDisplay, testCase.TestMethod);
#else
yield return new SkippableTheoryTestCase(skippingExceptionNames, this.diagnosticMessageSink, defaultMethodDisplay, discoveryOptions.MethodDisplayOptionsOrDefault(), testCase.TestMethod);
#endif
}
else
{
#if NET45
yield return new SkippableFactTestCase(skippingExceptionNames, this.diagnosticMessageSink, defaultMethodDisplay, testCase.TestMethod, testCase.TestMethodArguments);
#else
yield return new SkippableFactTestCase(skippingExceptionNames, this.diagnosticMessageSink, defaultMethodDisplay, discoveryOptions.MethodDisplayOptionsOrDefault(), testCase.TestMethod, testCase.TestMethodArguments);
#endif
}
}
}
Expand Down
6 changes: 0 additions & 6 deletions src/Xunit.SkippableFact/Sdk/SkippableTheoryTestCase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,12 @@ public SkippableTheoryTestCase()
/// <param name="defaultMethodDisplay">The preferred test name derivation.</param>
/// <param name="testMethod">The test method.</param>
public SkippableTheoryTestCase(string[] skippingExceptionNames, IMessageSink diagnosticMessageSink, TestMethodDisplay defaultMethodDisplay, ITestMethod testMethod)
#if NET45
: base(diagnosticMessageSink, defaultMethodDisplay, testMethod)
#else
: base(diagnosticMessageSink, defaultMethodDisplay, TestMethodDisplayOptions.None, testMethod)
#endif
{
Requires.NotNull(skippingExceptionNames, nameof(skippingExceptionNames));
this.SkippingExceptionNames = skippingExceptionNames;
}

#if !NET45
/// <summary>
/// Initializes a new instance of the <see cref="SkippableTheoryTestCase"/> class.
/// </summary>
Expand All @@ -60,7 +55,6 @@ public SkippableTheoryTestCase(string[] skippingExceptionNames, IMessageSink dia
Requires.NotNull(skippingExceptionNames, nameof(skippingExceptionNames));
this.SkippingExceptionNames = skippingExceptionNames;
}
#endif

/// <summary>
/// Gets an array of the full names of the exception types which should be interpreted as a skipped test.
Expand Down

0 comments on commit d10db23

Please sign in to comment.