Array entries in Records don't serialize correctly in log #3857
Labels
Area: Testing Platform
Belongs to the Microsoft.Testing.Platform core library
Needs: Triage 🔍
Type: Bug
Describe the bug
public sealed record TestMethodIdentifierProperty(string AssemblyFullName, string Namespace, string TypeName, string MethodName, string[] ParameterTypeFullNames, string ReturnTypeFullName) : IProperty
is serialized to log via call to
.ToString()
. This causes members that don't serialize well to just print the type name, e.g. :string[] ParameterTypeFullNames
will seralize asSystem.String[]
making the values invisible in log.Similar issue is happening with
StepTimingInfo[]
onTimingProperty
, orTrxMessage[]
Serialization can be customized by implementing
PrintMembers
manually.Youssef did some previous work here to automate this via source gen. Maybe it would be worth revisiting, to fix this issue without us writing the serializers manually https://github.com/Youssef1313/PrintMembersGenerator
(docs on writing it manually: https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/record#printmembers-formatting-in-derived-records)
As shown by these xunit and mstest diag logs:
The text was updated successfully, but these errors were encountered: