-
Notifications
You must be signed in to change notification settings - Fork 731
Closed
Description
Description
BeXmlSerializable creates a clone using XmlSerializer. XmlSerializer ignores members marked by XmlIgnoreAttribute.
The resulting clone is compared with the original. But this comparison does NOT ignore members marked by XmlIgnoreAttibute.
Reproduction Steps
public class DemoData
{
public string Id { get; set; }
[XmlIgnore]
public Guid IdWrapper
{
get => Guid.Parse(this.Id);
set => this.Id = value.ToString();
}
[XmlIgnore]
public string IgnoreMe { get; set; }
public string Name { get; set; }
}
// Arrange
var sut = new DemoData { Id = "m2", Name = "test 2", IgnoreMe = "ignore me" };
// Act
sut.Should().BeXmlSerializable();Expected behavior
Test should succeed.
Actual behavior
Test fails.
Regression?
No response
Known Workarounds
No response
Configuration
FluentAssertions Version="6.12.0"
MSTest.TestAdapter/Framework Version="2.2.8"
net472 and net6.0-windows
Other information
No response
Are you willing to help with a pull-request?
No
tacosontitan