Skip to content

Commit

Permalink
Roll back singleton NullMessageSink and NullSourceInformationProvider
Browse files Browse the repository at this point in the history
  • Loading branch information
bradwilson committed Oct 8, 2023
1 parent 45078f3 commit 4d9d4fc
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 13 deletions.
8 changes: 2 additions & 6 deletions src/common/NullMessageSink.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
using System.Collections.Generic;
using Xunit.Abstractions;
using Xunit.Sdk;

#if XUNIT_FRAMEWORK
namespace Xunit.Sdk
#else
using Xunit.Sdk;

namespace Xunit
#endif
{
Expand All @@ -17,11 +18,6 @@ public class NullMessageSink : LongLivedMarshalByRefObject, IMessageSink
, IMessageSinkWithTypes
#endif
{
/// <summary>
/// Gets the singleton instance of the <see cref="NullMessageSink"/>.
/// </summary>
public static NullMessageSink Instance { get; } = new NullMessageSink();

/// <inheritdoc/>
public void Dispose() { }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,6 @@ namespace Xunit
/// </summary>
public class NullSourceInformationProvider : LongLivedMarshalByRefObject, ISourceInformationProvider
{
/// <summary>
/// Gets the singleton instance of the <see cref="NullSourceInformationProvider"/>.
/// </summary>
public static NullSourceInformationProvider Instance { get; } = new NullSourceInformationProvider();

/// <inheritdoc/>
public ISourceInformation GetSourceInformation(ITestCase testCase)
{
Expand Down
4 changes: 2 additions & 2 deletions src/xunit.runner.utility/Frameworks/XunitFrontController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ public class XunitFrontController : IFrontController, ITestCaseDescriptorProvide
this.configFileName = configFileName;
this.shadowCopy = shadowCopy;
this.shadowCopyFolder = shadowCopyFolder;
this.sourceInformationProvider = sourceInformationProvider ?? NullSourceInformationProvider.Instance;
this.diagnosticMessageSink = diagnosticMessageSink ?? NullMessageSink.Instance;
this.sourceInformationProvider = sourceInformationProvider ?? new NullSourceInformationProvider();
this.diagnosticMessageSink = diagnosticMessageSink ?? new NullMessageSink();

Guard.FileExists("assemblyFileName", assemblyFileName);
}
Expand Down

0 comments on commit 4d9d4fc

Please sign in to comment.