Skip to content

Commit

Permalink
#411: The latest xunit.runner.visualstudio does not work with Mono
Browse files Browse the repository at this point in the history
  • Loading branch information
bradwilson committed Aug 6, 2024
1 parent 7780e56 commit 5f40a92
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<TunnelVisionLabsReferenceAssemblyAnnotatorVersion>1.0.0-alpha.160</TunnelVisionLabsReferenceAssemblyAnnotatorVersion>
<XunitAnalyzersVersion>1.16.0-pre.23</XunitAnalyzersVersion>
<XunitV2Version>2.9.1-pre.8</XunitV2Version>
<XunitV3Version>0.2.0-pre.79</XunitV3Version>
<XunitV3Version>0.2.0-pre.80</XunitV3Version>
</PropertyGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -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);

/// <inheritdoc/>
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);
}

/// <inheritdoc/>
Expand Down

0 comments on commit 5f40a92

Please sign in to comment.