Skip to content

Commit

Permalink
DateTime and TimeOnly also work with NUnit 3
Browse files Browse the repository at this point in the history
  • Loading branch information
manfred-brands committed Jan 8, 2025
1 parent fc1f568 commit 31dcac4
Showing 1 changed file with 14 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -767,6 +767,20 @@ public void TestWithGenericParameter<T>(T arg1) { }
RoslynAssert.Valid(this.analyzer, testCode);
}

#if NET6_0_OR_GREATER
[TestCaseSource(nameof(SpecialConversions_NET6))]
public void AnalyzeWhenArgumentIsSpecialConversionNET6(string value, Type targetType)
{
var testCode = TestUtility.WrapClassInNamespaceAndAddUsing($@"
public sealed class AnalyzeWhenArgumentIsSpecialConversion
{{
[TestCase(""{value}"")]
public void Test({targetType.Name} a) {{ }}
}}");
RoslynAssert.Valid(this.analyzer, testCode);
}
#endif

#if NUNIT4
#if NET6_0_OR_GREATER
[Test]
Expand Down Expand Up @@ -835,18 +849,6 @@ public void TestWithGenericParameter<T>(T arg1) { }
}");
RoslynAssert.Valid(this.analyzer, testCode);
}

[TestCaseSource(nameof(SpecialConversions_NET6))]
public void AnalyzeWhenArgumentIsSpecialConversionNET6(string value, Type targetType)
{
var testCode = TestUtility.WrapClassInNamespaceAndAddUsing($@"
public sealed class AnalyzeWhenArgumentIsSpecialConversion
{{
[TestCase(""{value}"")]
public void Test({targetType.Name} a) {{ }}
}}");
RoslynAssert.Valid(this.analyzer, testCode);
}
#endif

[Test]
Expand Down

0 comments on commit 31dcac4

Please sign in to comment.