Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Serializing/Deserializing ValueTuples #241

Open
ycherkes opened this issue Aug 10, 2023 · 1 comment
Open

Serializing/Deserializing ValueTuples #241

ycherkes opened this issue Aug 10, 2023 · 1 comment
Labels

Comments

@ycherkes
Copy link

YAXLib serializes System.Tuple successfully but ignores the content of System.ValueTuple.

Expected: the test below passes

Actual: the test fails.

[Test]
public void ValueTupleTest()
{
    const string expected =
        """
            <ValueTupleOfStringInt32>
              <Item1>This is test</Item1>
              <Item2>10</Item2>
            </ValueTupleOfStringInt32>
            """;
    var serializer = CreateSerializer<ValueTuple<string, int>>(new SerializerOptions
    {
        ExceptionHandlingPolicies = YAXExceptionHandlingPolicies.DoNotThrow,
        ExceptionBehavior = YAXExceptionTypes.Warning,
        SerializationOptions = YAXSerializationOptions.SerializeNullObjects
    });
    var got = serializer.Serialize(("This is test", 10));
    Assert.That(got, Is.EqualTo(expected));
}
@axunonb
Copy link
Collaborator

axunonb commented Aug 10, 2023

Yap, not implemented yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants