diff --git a/Versions.props b/Versions.props index 0428a3f..9024c71 100644 --- a/Versions.props +++ b/Versions.props @@ -12,7 +12,7 @@ 1.0.0-alpha.160 1.16.0-pre.23 2.9.1-pre.8 - 0.2.0-pre.79 + 0.2.0-pre.80 diff --git a/src/xunit.runner.visualstudio/Utility/VisualStudioSourceInformationProvider.cs b/src/xunit.runner.visualstudio/Utility/VisualStudioSourceInformationProvider.cs index cb85eb3..0009b80 100644 --- a/src/xunit.runner.visualstudio/Utility/VisualStudioSourceInformationProvider.cs +++ b/src/xunit.runner.visualstudio/Utility/VisualStudioSourceInformationProvider.cs @@ -13,23 +13,24 @@ namespace Xunit.Runner.VisualStudio; public sealed class VisualStudioSourceInformationProvider( string assemblyFileName, DiagnosticMessageSink diagnosticMessageSink) : - ISourceInformationProvider + ISourceInformationProvider { + static readonly SourceInformation nullSourceInformation = new(null, null); readonly DiaSessionWrapper session = new(assemblyFileName, diagnosticMessageSink); /// - public (string? sourceFile, int? sourceLine) GetSourceInformation( + public SourceInformation GetSourceInformation( string? testClassName, string? testMethodName) { if (testClassName is null || testMethodName is null) - return (null, null); + return nullSourceInformation; var navData = session.GetNavigationData(testClassName, testMethodName); if (navData is null || navData.FileName is null) - return (null, null); + return nullSourceInformation; - return (navData.FileName, navData.MinLineNumber); + return new(navData.FileName, navData.MinLineNumber); } ///