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

Enable DefaultValueAttributeSupport in partial trim mode. #9525

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
XmlSerializer test for DefaultValueAttributes
  • Loading branch information
matouskozak committed Nov 19, 2024
commit 14cfd74a6f924109abf13894e5106db44ada51a5
23 changes: 23 additions & 0 deletions tests/Mono.Android-Tests/System.Xml/XmlSerializer.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
using System.Xml.Serialization;
using System.ComponentModel;

using NUnit.Framework;

namespace System.XmlTests {
public class C {
[DefaultValue(typeof(C), "c")]
public Type? T { get; }
}

[TestFixture]
public class XmlSerializerTest {

[Test]
public void TrimmingDefaultValueAttribute ()
{
// Context: https://github.com/dotnet/runtime/issues/109724
var s = new XmlSerializer(typeof(C));
_ = new C().T; // Prevent C.T from being removed by trimming
}
}
}
Loading