diff --git a/test/Common/SerialConfiguration.cs b/test/Common/SerialConfiguration.cs index acf22a5..b9eb64f 100644 --- a/test/Common/SerialConfiguration.cs +++ b/test/Common/SerialConfiguration.cs @@ -36,9 +36,7 @@ public static string SourcePort { if (s_SourcePort is null) { lock (m_SyncLock) { - if (s_SourcePort is null) { - s_SourcePort = AppSettings.Settings[OSPrefix + "SourcePort"].Value; - } + s_SourcePort ??= AppSettings.Settings[OSPrefix + "SourcePort"].Value; } } return s_SourcePort; @@ -51,9 +49,7 @@ public static string DestPort { if (s_DestPort is null) { lock (m_SyncLock) { - if (s_DestPort is null) { - s_DestPort = AppSettings.Settings[OSPrefix + "DestPort"].Value; - } + s_DestPort ??= AppSettings.Settings[OSPrefix + "DestPort"].Value; } } return s_DestPort; diff --git a/test/SerialPortStreamManualTest/GlobalSuppressions.cs b/test/SerialPortStreamManualTest/GlobalSuppressions.cs index 72fd823..2cefe20 100644 --- a/test/SerialPortStreamManualTest/GlobalSuppressions.cs +++ b/test/SerialPortStreamManualTest/GlobalSuppressions.cs @@ -5,5 +5,4 @@ using System.Diagnostics.CodeAnalysis; -[assembly: SuppressMessage("Style", "IDE0074:Use compound assignment", Justification = ".NET Framework 4.0 compatibility")] [assembly: SuppressMessage("Style", "IDE0230:Use UTF-8 string literal", Justification = "Testing byte streams, not UTF8 strings")] diff --git a/test/SerialPortStreamNativeTest/GlobalSuppressions.cs b/test/SerialPortStreamNativeTest/GlobalSuppressions.cs index 36cbf91..47da094 100644 --- a/test/SerialPortStreamNativeTest/GlobalSuppressions.cs +++ b/test/SerialPortStreamNativeTest/GlobalSuppressions.cs @@ -7,5 +7,4 @@ [assembly: SuppressMessage("Performance", "CA1835:Prefer the 'Memory'-based overloads for 'ReadAsync' and 'WriteAsync'", Justification = "Explicit testing of API")] [assembly: SuppressMessage("Style", "IDE0056:Use index operator", Justification = ".NET 4.0 Framework Compatibility")] -[assembly: SuppressMessage("Style", "IDE0074:Use compound assignment", Justification = ".NET Framework 4.0 compatibility")] [assembly: SuppressMessage("Style", "IDE0230:Use UTF-8 string literal", Justification = "Testing byte streams, not UTF8 strings")] diff --git a/test/SerialPortStreamTest/GlobalSuppressions.cs b/test/SerialPortStreamTest/GlobalSuppressions.cs index 5c8005b..8f348cd 100644 --- a/test/SerialPortStreamTest/GlobalSuppressions.cs +++ b/test/SerialPortStreamTest/GlobalSuppressions.cs @@ -6,6 +6,5 @@ using System.Diagnostics.CodeAnalysis; [assembly: SuppressMessage("Style", "IDE0056:Use index operator", Justification = ".NET Framework 4.0 compatibility")] -[assembly: SuppressMessage("Style", "IDE0074:Use compound assignment", Justification = ".NET Framework 4.0 compatibility")] [assembly: SuppressMessage("Style", "IDE0230:Use UTF-8 string literal", Justification = "Testing byte streams, not UTF8 strings")] [assembly: SuppressMessage("Performance", "CA1835:Prefer the 'Memory'-based overloads for 'ReadAsync' and 'WriteAsync'", Justification = "Specific API Test")]