diff --git a/TUnit.Analyzers/Extensions/TypeExtensions.cs b/TUnit.Analyzers/Extensions/TypeExtensions.cs index 72d18907fc..0b22c430ae 100644 --- a/TUnit.Analyzers/Extensions/TypeExtensions.cs +++ b/TUnit.Analyzers/Extensions/TypeExtensions.cs @@ -8,7 +8,7 @@ public static class TypeExtensions { public static string GetMetadataName(this Type type) { - return $"{type.Namespace}.{type.Name}"; + return string.IsNullOrEmpty(type.Namespace) ? type.Name : $"{type.Namespace}.{type.Name}"; } public static string GetFullNameWithoutGenericArity(this Type type)