diff --git a/src/Adapter/MSTest.TestAdapter/TestingPlatformAdapter/MSTestTestNodeConverter.cs b/src/Adapter/MSTest.TestAdapter/TestingPlatformAdapter/MSTestTestNodeConverter.cs index 32f825b045..c407fb6303 100644 --- a/src/Adapter/MSTest.TestAdapter/TestingPlatformAdapter/MSTestTestNodeConverter.cs +++ b/src/Adapter/MSTest.TestAdapter/TestingPlatformAdapter/MSTestTestNodeConverter.cs @@ -150,8 +150,8 @@ private static void AddTestMethodIdentifier(TestNode testNode, TestMethod testMe parameterTypes ??= []; int lastIndexOfDot = managedType.LastIndexOf('.'); - string @namespace = lastIndexOfDot == -1 ? string.Empty : managedType.Substring(0, lastIndexOfDot); - string typeName = lastIndexOfDot == -1 ? managedType : managedType.Substring(lastIndexOfDot + 1); + string @namespace = lastIndexOfDot == -1 ? string.Empty : managedType[..lastIndexOfDot]; + string typeName = lastIndexOfDot == -1 ? managedType : managedType[(lastIndexOfDot + 1)..]; // AssemblyFullName and ReturnTypeFullName are not carried by the neutral model today; kept empty to match // the current (bridge) behavior. Populating them is a follow-up enabled by this native path. @@ -305,7 +305,7 @@ private static bool TryParseFullyQualifiedType(string fullyQualifiedName, [NotNu return false; } - fullyQualifiedType = fullyQualifiedName.Substring(0, lastDotIndexBeforeOpenBracket); + fullyQualifiedType = fullyQualifiedName[..lastDotIndexBeforeOpenBracket]; return true; } } diff --git a/src/Adapter/MSTestAdapter.PlatformServices/Execution/TestMethodRunner.DataSource.cs b/src/Adapter/MSTestAdapter.PlatformServices/Execution/TestMethodRunner.DataSource.cs index 2c71dc5035..137aec3408 100644 --- a/src/Adapter/MSTestAdapter.PlatformServices/Execution/TestMethodRunner.DataSource.cs +++ b/src/Adapter/MSTestAdapter.PlatformServices/Execution/TestMethodRunner.DataSource.cs @@ -52,7 +52,7 @@ private async Task ExecuteTestFromDataSourceAttributeAsync(List resu try { IEnumerable? dataRows = PlatformServiceProvider.Instance.TestDataSource.GetData(_testMethodInfo, _testContext); - if (dataRows == null) + if (dataRows is null) { var inconclusiveResult = new TestResult {