fix for Nullable<bool> default values

This commit is contained in:
daver32
2022-10-22 21:17:09 +02:00
parent 4d7c45762b
commit 696601ef18
3 changed files with 13 additions and 4 deletions
@@ -213,7 +213,7 @@ public class MethodGenerationTests
method.ReturnType.Should().Be(typeof(void));
var parameters = method.GetParameters();
parameters.Should().HaveCount(7);
parameters.Should().HaveCount(10);
parameters.Select(x => x.IsOptional).Should().AllBeEquivalentTo(true);
parameters[0].DefaultValue.Should().Be("cGFyYW0=");
@@ -223,7 +223,10 @@ public class MethodGenerationTests
parameters[4].DefaultValue.Should().Be(0.3d);
parameters[5].DefaultValue.Should().Be(true);
parameters[6].DefaultValue.Should().Be(false);
parameters[7].DefaultValue.Should().Be(true);
parameters[8].DefaultValue.Should().Be(false);
parameters[9].DefaultValue.Should().Be(null);
_sut.VoidMethodWithOptionalParams();
}
@@ -319,7 +322,10 @@ internal class MethodsTestService : IMethodsTestService
double doubleLiteral = 0.2,
decimal decimalLiteral = 0.3m,
bool trueLiteral = true,
bool falseLiteral = false)
bool falseLiteral = false,
bool? nullableTrueLiteral = true,
bool? nullableFalseLiteral = false,
bool? nullableNullBoolLiteral = null)
{
}