public partial class DefaultValue
{
public readonly int Value;
public readonly int ValueSet;
[YamlConstructor]
public DefaultValue(int valueSet, int value = 12)
{
ValueSet = valueSet;
Value = value;
}
}
and this test is failing
public void TestDefaultValue()
{
string testYaml = @"---
valueSet: 22";
var deserialized = YamlSerializer.Deserialize<DefaultValue>(Encoding.UTF8.GetBytes(testYaml));
Assert.That(deserialized.ValueSet, Is.EqualTo(22));
Assert.That(deserialized.Value, Is.EqualTo(12));
}
with following configuration Test is not passed
and this test is failing