From 6c21fff106932a50893a96661b8cd74d723e00e8 Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Thu, 16 Jul 2020 10:06:29 +0200 Subject: [PATCH] [xharness] Fix finding testable types in test assemblies. Fixes #xamarin/maccore@2267. Apparently a null namespace when using Reflection can be an empty namespace in Cecil. Fixes https://github.com/xamarin/maccore/issues/2267. --- .../TestImporter/ProjectDefinition.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/xharness/Microsoft.DotNet.XHarness.iOS.Shared/TestImporter/ProjectDefinition.cs b/tests/xharness/Microsoft.DotNet.XHarness.iOS.Shared/TestImporter/ProjectDefinition.cs index 7114b773477e..97e006f81e4e 100644 --- a/tests/xharness/Microsoft.DotNet.XHarness.iOS.Shared/TestImporter/ProjectDefinition.cs +++ b/tests/xharness/Microsoft.DotNet.XHarness.iOS.Shared/TestImporter/ProjectDefinition.cs @@ -127,7 +127,7 @@ public bool Validate () if (t.HasGenericParameters) return false; - if (t.Namespace == null) + if (string.IsNullOrEmpty (t.Namespace)) return false; if (!t.FullName.EndsWith ("Test", StringComparison.OrdinalIgnoreCase) && !t.FullName.EndsWith ("Tests", StringComparison.OrdinalIgnoreCase))