Skip to content

Commit 5ad72eb

Browse files
committed
Fix ArrayParameterTransformerTests
Benefit of the doubt is expected and will now be accounted for
1 parent fcb5796 commit 5ad72eb

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

tests/SilkTouch/SilkTouch/ArrayParameterTransformerTests.cs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@
66
using Microsoft.CodeAnalysis;
77
using Microsoft.CodeAnalysis.CSharp;
88
using Microsoft.CodeAnalysis.CSharp.Syntax;
9+
using Microsoft.Extensions.Options;
910
using NUnit.Framework;
11+
using Silk.NET.SilkTouch.Mods;
1012
using Silk.NET.SilkTouch.Mods.Metadata;
1113
using Silk.NET.SilkTouch.Mods.Transformation;
1214

@@ -15,6 +17,13 @@ namespace Silk.NET.SilkTouch.UnitTests;
1517
[TestFixture]
1618
public class ArrayParameterTransformerTests
1719
{
20+
struct Options : IOptionsSnapshot<TransformFunctions.Configuration>
21+
{
22+
public required TransformFunctions.Configuration Value { get; init; }
23+
24+
public TransformFunctions.Configuration Get(string? name) => Value;
25+
}
26+
1827
[
1928
Test,
2029
TestCase(
@@ -198,7 +207,7 @@ public void Transform(string originalMethod, string expectedMethod)
198207
var og =
199208
SyntaxFactory.ParseMemberDeclaration(originalMethod) as MethodDeclarationSyntax
200209
?? throw new InvalidOperationException("failed to cast original");
201-
var uut = new ArrayParameterTransformer(null);
210+
var uut = new ArrayParameterTransformer(new Options() { Value = new() { IntReturnsMaybeBool = false, BenefitOfTheDoubtArrayTransformation = true } });
202211
var result = og;
203212
uut.Transform(og, new TestApiMetadata { Original = og }, (x) => result = x);
204213
Assert.That(

0 commit comments

Comments
 (0)