From 20ca34261ee6a1b726b8e3477010fa605fcf0f63 Mon Sep 17 00:00:00 2001 From: Marco Rossignoli Date: Tue, 3 Jan 2023 17:40:51 +0100 Subject: [PATCH 1/7] fix string conversion --- .../ObjectModel/TestOutcome.cs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/Microsoft.TestPlatform.Extensions.TrxLogger/ObjectModel/TestOutcome.cs b/src/Microsoft.TestPlatform.Extensions.TrxLogger/ObjectModel/TestOutcome.cs index b89a457e5b..8cd303ad76 100644 --- a/src/Microsoft.TestPlatform.Extensions.TrxLogger/ObjectModel/TestOutcome.cs +++ b/src/Microsoft.TestPlatform.Extensions.TrxLogger/ObjectModel/TestOutcome.cs @@ -88,13 +88,20 @@ internal enum TestOutcome /// Pending, + // NOTE: OLD CODE WAS Min = Error and Max = Pending + // This doesn't work well with the coversion to string for the reason explained here: + // https://learn.microsoft.com/en-us/dotnet/api/system.enum.tostring?view=net-7.0 + // Notes to Callers: If multiple enumeration members have the same underlying value and you attempt to retrieve the + // string representation of an enumeration member's name based on its underlying value + // We fixed removing the equality above to break less as possible. But the returned value won't be the expected Min/Max + /// /// The min value of this enum /// - Min = Error, + Min, /// /// The max value of this enum /// - Max = Pending + Max } From 8f15c8180fd9575c2ec010f7748397ef0dcef9f8 Mon Sep 17 00:00:00 2001 From: Marco Rossignoli Date: Wed, 4 Jan 2023 12:29:28 +0100 Subject: [PATCH 2/7] Update src/Microsoft.TestPlatform.Extensions.TrxLogger/ObjectModel/TestOutcome.cs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Amaury Levé --- .../ObjectModel/TestOutcome.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Microsoft.TestPlatform.Extensions.TrxLogger/ObjectModel/TestOutcome.cs b/src/Microsoft.TestPlatform.Extensions.TrxLogger/ObjectModel/TestOutcome.cs index 8cd303ad76..2b8218a9b3 100644 --- a/src/Microsoft.TestPlatform.Extensions.TrxLogger/ObjectModel/TestOutcome.cs +++ b/src/Microsoft.TestPlatform.Extensions.TrxLogger/ObjectModel/TestOutcome.cs @@ -88,7 +88,7 @@ internal enum TestOutcome /// Pending, - // NOTE: OLD CODE WAS Min = Error and Max = Pending + // NOTE: OLD CODE WAS Min = Error and Max = Pending // This doesn't work well with the coversion to string for the reason explained here: // https://learn.microsoft.com/en-us/dotnet/api/system.enum.tostring?view=net-7.0 // Notes to Callers: If multiple enumeration members have the same underlying value and you attempt to retrieve the From 72c9325b7017977ea1ff9db267f855ec5bd9fe88 Mon Sep 17 00:00:00 2001 From: Marco Rossignoli Date: Wed, 4 Jan 2023 12:29:34 +0100 Subject: [PATCH 3/7] Update src/Microsoft.TestPlatform.Extensions.TrxLogger/ObjectModel/TestOutcome.cs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Amaury Levé --- .../ObjectModel/TestOutcome.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Microsoft.TestPlatform.Extensions.TrxLogger/ObjectModel/TestOutcome.cs b/src/Microsoft.TestPlatform.Extensions.TrxLogger/ObjectModel/TestOutcome.cs index 2b8218a9b3..992d4171bb 100644 --- a/src/Microsoft.TestPlatform.Extensions.TrxLogger/ObjectModel/TestOutcome.cs +++ b/src/Microsoft.TestPlatform.Extensions.TrxLogger/ObjectModel/TestOutcome.cs @@ -89,7 +89,7 @@ internal enum TestOutcome Pending, // NOTE: OLD CODE WAS Min = Error and Max = Pending - // This doesn't work well with the coversion to string for the reason explained here: + // This doesn't work well with the conversion to string for the reason explained here: // https://learn.microsoft.com/en-us/dotnet/api/system.enum.tostring?view=net-7.0 // Notes to Callers: If multiple enumeration members have the same underlying value and you attempt to retrieve the // string representation of an enumeration member's name based on its underlying value From 99d0f950e0c855c0a28cb3739efb1e47b7c6bf69 Mon Sep 17 00:00:00 2001 From: Marco Rossignoli Date: Wed, 4 Jan 2023 12:29:39 +0100 Subject: [PATCH 4/7] Update src/Microsoft.TestPlatform.Extensions.TrxLogger/ObjectModel/TestOutcome.cs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Amaury Levé --- .../ObjectModel/TestOutcome.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Microsoft.TestPlatform.Extensions.TrxLogger/ObjectModel/TestOutcome.cs b/src/Microsoft.TestPlatform.Extensions.TrxLogger/ObjectModel/TestOutcome.cs index 992d4171bb..10e953e335 100644 --- a/src/Microsoft.TestPlatform.Extensions.TrxLogger/ObjectModel/TestOutcome.cs +++ b/src/Microsoft.TestPlatform.Extensions.TrxLogger/ObjectModel/TestOutcome.cs @@ -90,7 +90,7 @@ internal enum TestOutcome // NOTE: OLD CODE WAS Min = Error and Max = Pending // This doesn't work well with the conversion to string for the reason explained here: - // https://learn.microsoft.com/en-us/dotnet/api/system.enum.tostring?view=net-7.0 + // https://learn.microsoft.com/dotnet/api/system.enum.tostring?view=net-7.0 // Notes to Callers: If multiple enumeration members have the same underlying value and you attempt to retrieve the // string representation of an enumeration member's name based on its underlying value // We fixed removing the equality above to break less as possible. But the returned value won't be the expected Min/Max From 16e9b542365995d841b27dcbf5842ae3fa8aef3d Mon Sep 17 00:00:00 2001 From: Marco Rossignoli Date: Wed, 4 Jan 2023 12:39:59 +0100 Subject: [PATCH 5/7] add remarks --- .../ObjectModel/TestOutcome.cs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/Microsoft.TestPlatform.Extensions.TrxLogger/ObjectModel/TestOutcome.cs b/src/Microsoft.TestPlatform.Extensions.TrxLogger/ObjectModel/TestOutcome.cs index 10e953e335..b807b5257b 100644 --- a/src/Microsoft.TestPlatform.Extensions.TrxLogger/ObjectModel/TestOutcome.cs +++ b/src/Microsoft.TestPlatform.Extensions.TrxLogger/ObjectModel/TestOutcome.cs @@ -98,10 +98,26 @@ internal enum TestOutcome /// /// The min value of this enum /// + /// + /// NOTE: OLD CODE WAS Min = Error + /// This doesn't work well with the conversion to string for the reason explained here: + /// https://learn.microsoft.com/dotnet/api/system.enum.tostring?view=net-7.0 + /// Notes to Callers: If multiple enumeration members have the same underlying value and you attempt to retrieve the + /// string representation of an enumeration member's name based on its underlying value + /// We fixed removing the equality above to break less as possible. But the returned value won't be the expected Min/Max + /// Min, /// /// The max value of this enum /// + /// + /// NOTE: OLD CODE WAS Max = Pending + /// This doesn't work well with the conversion to string for the reason explained here: + /// https://learn.microsoft.com/dotnet/api/system.enum.tostring?view=net-7.0 + /// Notes to Callers: If multiple enumeration members have the same underlying value and you attempt to retrieve the + /// string representation of an enumeration member's name based on its underlying value + /// We fixed removing the equality above to break less as possible. But the returned value won't be the expected Min/Max + /// Max } From d3d62b5a51efab3f189a87aeca84b3746b88d65a Mon Sep 17 00:00:00 2001 From: Marco Rossignoli Date: Wed, 4 Jan 2023 12:40:10 +0100 Subject: [PATCH 6/7] cleanup --- .../ObjectModel/TestOutcome.cs | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/Microsoft.TestPlatform.Extensions.TrxLogger/ObjectModel/TestOutcome.cs b/src/Microsoft.TestPlatform.Extensions.TrxLogger/ObjectModel/TestOutcome.cs index b807b5257b..a0ad7dba0f 100644 --- a/src/Microsoft.TestPlatform.Extensions.TrxLogger/ObjectModel/TestOutcome.cs +++ b/src/Microsoft.TestPlatform.Extensions.TrxLogger/ObjectModel/TestOutcome.cs @@ -88,13 +88,6 @@ internal enum TestOutcome /// Pending, - // NOTE: OLD CODE WAS Min = Error and Max = Pending - // This doesn't work well with the conversion to string for the reason explained here: - // https://learn.microsoft.com/dotnet/api/system.enum.tostring?view=net-7.0 - // Notes to Callers: If multiple enumeration members have the same underlying value and you attempt to retrieve the - // string representation of an enumeration member's name based on its underlying value - // We fixed removing the equality above to break less as possible. But the returned value won't be the expected Min/Max - /// /// The min value of this enum /// From 3193d9a29b5835bdf065c6b96f7588980e5dc206 Mon Sep 17 00:00:00 2001 From: Marco Rossignoli Date: Wed, 4 Jan 2023 15:04:36 +0100 Subject: [PATCH 7/7] remove enum values --- .../ObjectModel/TestOutcome.cs | 28 +------------------ 1 file changed, 1 insertion(+), 27 deletions(-) diff --git a/src/Microsoft.TestPlatform.Extensions.TrxLogger/ObjectModel/TestOutcome.cs b/src/Microsoft.TestPlatform.Extensions.TrxLogger/ObjectModel/TestOutcome.cs index a0ad7dba0f..9091d8fd94 100644 --- a/src/Microsoft.TestPlatform.Extensions.TrxLogger/ObjectModel/TestOutcome.cs +++ b/src/Microsoft.TestPlatform.Extensions.TrxLogger/ObjectModel/TestOutcome.cs @@ -86,31 +86,5 @@ internal enum TestOutcome /// /// Test is in the execution queue, was not started yet. /// - Pending, - - /// - /// The min value of this enum - /// - /// - /// NOTE: OLD CODE WAS Min = Error - /// This doesn't work well with the conversion to string for the reason explained here: - /// https://learn.microsoft.com/dotnet/api/system.enum.tostring?view=net-7.0 - /// Notes to Callers: If multiple enumeration members have the same underlying value and you attempt to retrieve the - /// string representation of an enumeration member's name based on its underlying value - /// We fixed removing the equality above to break less as possible. But the returned value won't be the expected Min/Max - /// - Min, - - /// - /// The max value of this enum - /// - /// - /// NOTE: OLD CODE WAS Max = Pending - /// This doesn't work well with the conversion to string for the reason explained here: - /// https://learn.microsoft.com/dotnet/api/system.enum.tostring?view=net-7.0 - /// Notes to Callers: If multiple enumeration members have the same underlying value and you attempt to retrieve the - /// string representation of an enumeration member's name based on its underlying value - /// We fixed removing the equality above to break less as possible. But the returned value won't be the expected Min/Max - /// - Max + Pending }