You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the course of testing the migration feature, I found another problem. In the following test setup, the first "Check" property is not set:
using ExtendedXmlSerializer.Configuration;
using ExtendedXmlSerializer.Tests.ReportedIssues.Support;
using FluentAssertions;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Xml.Linq;
using Xunit;
namespace ExtendedXmlSerializer.Tests.ReportedIssues
{
public sealed class Issue613Tests
{
[Fact]
public void Verify()
{
var serializer = new ConfigurationContainer().Type<BaseNamespace.Container>()
.AddMigration(EmptyMigration.Default)
.Create()
.ForTesting();
var container = new BaseNamespace.Container();
container.Content.Add(new InheritNamespace.Inherit() { Check = new BaseNamespace.BaseCheck() });
container.Content.Add(new BaseNamespace.Base() { Check = new InheritNamespace.InheritCheck() });
serializer.Cycle(container).Should().BeEquivalentTo(container);
}
}
sealed class EmptyMigration : IEnumerable<Action<XElement>>
{
public static EmptyMigration Default { get; } = new EmptyMigration();
EmptyMigration() { }
public IEnumerator<Action<XElement>> GetEnumerator()
{
yield break;
}
IEnumerator IEnumerable.GetEnumerator() => GetEnumerator();
}
}
namespace BaseNamespace
{
public class Container
{
public List<Base> Content { get; set; } = new List<Base>();
}
public class Base
{
public BaseCheck Check { get; set; }
}
public class BaseCheck { }
}
namespace InheritNamespace
{
public class Inherit : BaseNamespace.Base { }
public class InheritCheck : BaseNamespace.BaseCheck { }
}
The problem seems to come from the reader formatter, which returns "ns1:Check" as the name of the object, although only "Check" would be correct. I have updated my pull request #613 with this fix.
The text was updated successfully, but these errors were encountered:
Wow @imperiobadgo I am really amazed that this works and all tests pass. That's a pretty significant change, but I guess it's only used for member reading which expect a local name. It makes me wonder if this will address the hacky exs:member attribute we have lurking in our code but I am firmly in the "if it ain't broke don't fix it" mentality with this project. 😁
As all tests pass I will accept/merge/deploy these changes. Thank you your contributions!
Oof... that was brutal. I was able to get NuGet deployed but apparently our documentation cannot be deployed now as the deploy key we used has expired and it is immediately unclear how to update it. I am deploying an attempt now let's hope that works. Closing these issues for now.
In the course of testing the migration feature, I found another problem. In the following test setup, the first "Check" property is not set:
This is the resulting xml:
The problem seems to come from the reader formatter, which returns "ns1:Check" as the name of the object, although only "Check" would be correct. I have updated my pull request #613 with this fix.
The text was updated successfully, but these errors were encountered: