diff --git a/src/xunit.runner.visualstudio/Constants.cs b/src/xunit.runner.visualstudio/Constants.cs index 97aef60..0543da4 100644 --- a/src/xunit.runner.visualstudio/Constants.cs +++ b/src/xunit.runner.visualstudio/Constants.cs @@ -1,6 +1,6 @@ namespace Xunit.Runner.VisualStudio; -public static class Constants +internal static class Constants { #if NETFRAMEWORK public const string ExecutorUri = "executor://xunit/VsTestRunner3/netfx/"; diff --git a/src/xunit.runner.visualstudio/Sinks/DiagnosticMessageSink.cs b/src/xunit.runner.visualstudio/Sinks/DiagnosticMessageSink.cs index 49f46e4..081b4c0 100644 --- a/src/xunit.runner.visualstudio/Sinks/DiagnosticMessageSink.cs +++ b/src/xunit.runner.visualstudio/Sinks/DiagnosticMessageSink.cs @@ -2,7 +2,7 @@ namespace Xunit.Runner.VisualStudio; -public class DiagnosticMessageSink : DiagnosticEventSink +internal class DiagnosticMessageSink : DiagnosticEventSink { public DiagnosticMessageSink( LoggerHelper log, diff --git a/src/xunit.runner.visualstudio/Sinks/VsDiscoverySink.cs b/src/xunit.runner.visualstudio/Sinks/VsDiscoverySink.cs index 51d8f56..c577582 100644 --- a/src/xunit.runner.visualstudio/Sinks/VsDiscoverySink.cs +++ b/src/xunit.runner.visualstudio/Sinks/VsDiscoverySink.cs @@ -15,7 +15,7 @@ namespace Xunit.Runner.VisualStudio; -public sealed class VsDiscoverySink : IVsDiscoverySink, IDisposable +internal sealed class VsDiscoverySink : IVsDiscoverySink, IDisposable { static readonly string Ellipsis = new((char)183, 3); const int MaximumDisplayNameLength = 447; diff --git a/src/xunit.runner.visualstudio/Sinks/VsExecutionSink.cs b/src/xunit.runner.visualstudio/Sinks/VsExecutionSink.cs index 942569f..124f6b4 100644 --- a/src/xunit.runner.visualstudio/Sinks/VsExecutionSink.cs +++ b/src/xunit.runner.visualstudio/Sinks/VsExecutionSink.cs @@ -14,7 +14,7 @@ namespace Xunit.Runner.VisualStudio; -public sealed class VsExecutionSink : TestMessageSink, IDisposable +internal sealed class VsExecutionSink : TestMessageSink, IDisposable { readonly Func cancelledThunk; readonly LoggerHelper logger; diff --git a/src/xunit.runner.visualstudio/TestPlatformContext.cs b/src/xunit.runner.visualstudio/TestPlatformContext.cs index 2748ef9..b2c2fa5 100644 --- a/src/xunit.runner.visualstudio/TestPlatformContext.cs +++ b/src/xunit.runner.visualstudio/TestPlatformContext.cs @@ -4,7 +4,7 @@ namespace Xunit.Runner.VisualStudio; /// Provides contextual information on a test run/discovery based on runsettings /// or the invocation (execution, discovery). /// -public struct TestPlatformContext +internal struct TestPlatformContext { /// /// Indicates if the test runner is running in design mode (meaning, inside the Visual Studio IDE). diff --git a/src/xunit.runner.visualstudio/Utility/AssemblyRunInfo.cs b/src/xunit.runner.visualstudio/Utility/AssemblyRunInfo.cs index af02f0f..50002a5 100644 --- a/src/xunit.runner.visualstudio/Utility/AssemblyRunInfo.cs +++ b/src/xunit.runner.visualstudio/Utility/AssemblyRunInfo.cs @@ -5,7 +5,7 @@ namespace Xunit.Runner.VisualStudio; -public class AssemblyRunInfo +internal class AssemblyRunInfo { AssemblyRunInfo( LoggerHelper logger, diff --git a/src/xunit.runner.visualstudio/Utility/LoggerHelper.cs b/src/xunit.runner.visualstudio/Utility/LoggerHelper.cs index d2acdff..d11f54c 100644 --- a/src/xunit.runner.visualstudio/Utility/LoggerHelper.cs +++ b/src/xunit.runner.visualstudio/Utility/LoggerHelper.cs @@ -6,7 +6,7 @@ namespace Xunit.Runner.VisualStudio; -public class LoggerHelper(IMessageLogger? logger, Stopwatch stopwatch) +internal class LoggerHelper(IMessageLogger? logger, Stopwatch stopwatch) { public IMessageLogger? InnerLogger { get; private set; } = logger; diff --git a/src/xunit.runner.visualstudio/Utility/RunSettings.cs b/src/xunit.runner.visualstudio/Utility/RunSettings.cs index 9ff7c24..3edbd91 100644 --- a/src/xunit.runner.visualstudio/Utility/RunSettings.cs +++ b/src/xunit.runner.visualstudio/Utility/RunSettings.cs @@ -6,7 +6,7 @@ namespace Xunit.Runner.VisualStudio; -public class RunSettings +internal class RunSettings { public AppDomainSupport? AppDomain { get; set; } public string? Culture { get; set; } diff --git a/src/xunit.runner.visualstudio/Utility/TestCaseFilter.cs b/src/xunit.runner.visualstudio/Utility/TestCaseFilter.cs index 836cb3d..edcff37 100644 --- a/src/xunit.runner.visualstudio/Utility/TestCaseFilter.cs +++ b/src/xunit.runner.visualstudio/Utility/TestCaseFilter.cs @@ -7,7 +7,7 @@ namespace Xunit.Runner.VisualStudio; -public class TestCaseFilter +internal class TestCaseFilter { const string DisplayNameString = "DisplayName"; const string FullyQualifiedNameString = "FullyQualifiedName"; diff --git a/src/xunit.runner.visualstudio/Utility/VisualStudioRunnerLogger.cs b/src/xunit.runner.visualstudio/Utility/VisualStudioRunnerLogger.cs index a041494..277d2a3 100644 --- a/src/xunit.runner.visualstudio/Utility/VisualStudioRunnerLogger.cs +++ b/src/xunit.runner.visualstudio/Utility/VisualStudioRunnerLogger.cs @@ -2,7 +2,7 @@ namespace Xunit.Runner.VisualStudio; -public class VisualStudioRunnerLogger(LoggerHelper loggerHelper) : +internal class VisualStudioRunnerLogger(LoggerHelper loggerHelper) : IRunnerLogger { static readonly object lockObject = new(); diff --git a/src/xunit.runner.visualstudio/VsTestRunner.cs b/src/xunit.runner.visualstudio/VsTestRunner.cs index 0e90c05..4d85b3a 100644 --- a/src/xunit.runner.visualstudio/VsTestRunner.cs +++ b/src/xunit.runner.visualstudio/VsTestRunner.cs @@ -120,22 +120,22 @@ public class VsTestRunner : ITestDiscoverer, ITestExecutor "xunit.v3.runner.utility.netstandard20.dll", }; - public static TestProperty ManagedMethodProperty { get; } = + internal static TestProperty ManagedMethodProperty { get; } = TestProperty.Register("TestCase.ManagedMethod", "ManagedMethod", string.Empty, string.Empty, typeof(string), x => !string.IsNullOrWhiteSpace(x as string), TestPropertyAttributes.Hidden, typeof(TestCase)); - public static TestProperty ManagedTypeProperty { get; } = + internal static TestProperty ManagedTypeProperty { get; } = TestProperty.Register("TestCase.ManagedType", "ManagedType", string.Empty, string.Empty, typeof(string), x => !string.IsNullOrWhiteSpace(x as string), TestPropertyAttributes.Hidden, typeof(TestCase)); - public static TestProperty SkipReasonProperty { get; } = + internal static TestProperty SkipReasonProperty { get; } = TestProperty.Register("XunitSkipReason", "xUnit.net Skip Reason", typeof(string), typeof(VsTestRunner)); - public static TestProperty TestCaseExplicitProperty { get; } = + internal static TestProperty TestCaseExplicitProperty { get; } = TestProperty.Register("XunitTestCaseExplicit", "xUnit.net Test Case Explicit Flag", typeof(bool), typeof(VsTestRunner)); - public static TestProperty TestCaseSerializationProperty { get; } = + internal static TestProperty TestCaseSerializationProperty { get; } = TestProperty.Register("XunitTestCaseSerialization", "xUnit.net Test Case Serialization", typeof(string), typeof(VsTestRunner)); - public static TestProperty TestCaseUniqueIDProperty { get; } = + internal static TestProperty TestCaseUniqueIDProperty { get; } = TestProperty.Register("XunitTestCaseUniqueID", "xUnit.net Test Case Unique ID", typeof(string), typeof(VsTestRunner)); public void Cancel() => @@ -307,7 +307,7 @@ async Task DiscoverTestsInAssembly( return true; } - public static IReadOnlyList GetAvailableRunnerReporters(LoggerHelper? logger) + internal static IReadOnlyList GetAvailableRunnerReporters(LoggerHelper? logger) { var result = RegisteredRunnerReporters.Get(typeof(VsTestRunner).Assembly, out var messages); @@ -318,7 +318,7 @@ public static IReadOnlyList GetAvailableRunnerReporters(LoggerH return result; } - public static IRunnerReporter GetRunnerReporter( + internal static IRunnerReporter GetRunnerReporter( LoggerHelper? logger, RunSettings runSettings) { diff --git a/src/xunit.runner.visualstudio/xunit.runner.visualstudio.csproj b/src/xunit.runner.visualstudio/xunit.runner.visualstudio.csproj index 99651f3..70df5b0 100644 --- a/src/xunit.runner.visualstudio/xunit.runner.visualstudio.csproj +++ b/src/xunit.runner.visualstudio/xunit.runner.visualstudio.csproj @@ -12,6 +12,10 @@ true + + + + diff --git a/test/test.xunit.runner.visualstudio/RunSettingsTests.cs b/test/test.xunit.runner.visualstudio/RunSettingsTests.cs index 30876bf..a42e78c 100644 --- a/test/test.xunit.runner.visualstudio/RunSettingsTests.cs +++ b/test/test.xunit.runner.visualstudio/RunSettingsTests.cs @@ -1,8 +1,10 @@ +extern alias VSTestAdapter; + using System; using Xunit; using Xunit.Runner.Common; -using Xunit.Runner.VisualStudio; using Xunit.Sdk; +using RunSettings = VSTestAdapter.Xunit.Runner.VisualStudio.RunSettings; public class RunSettingsTests { diff --git a/test/test.xunit.runner.visualstudio/RunnerReporterTests.cs b/test/test.xunit.runner.visualstudio/RunnerReporterTests.cs index 04bfddb..04d3856 100644 --- a/test/test.xunit.runner.visualstudio/RunnerReporterTests.cs +++ b/test/test.xunit.runner.visualstudio/RunnerReporterTests.cs @@ -1,10 +1,14 @@ +extern alias VSTestAdapter; + using System; using System.Diagnostics; using Microsoft.VisualStudio.TestPlatform.ObjectModel.Logging; using NSubstitute; using Xunit; using Xunit.Runner.Common; -using Xunit.Runner.VisualStudio; +using LoggerHelper = VSTestAdapter.Xunit.Runner.VisualStudio.LoggerHelper; +using RunSettings = VSTestAdapter.Xunit.Runner.VisualStudio.RunSettings; +using VsTestRunner = VSTestAdapter.Xunit.Runner.VisualStudio.VsTestRunner; public class RunnerReporterTests { diff --git a/test/test.xunit.runner.visualstudio/Sinks/VsDiscoverySinkTests.cs b/test/test.xunit.runner.visualstudio/Sinks/VsDiscoverySinkTests.cs index f32769d..d8a641b 100644 --- a/test/test.xunit.runner.visualstudio/Sinks/VsDiscoverySinkTests.cs +++ b/test/test.xunit.runner.visualstudio/Sinks/VsDiscoverySinkTests.cs @@ -1,8 +1,14 @@ +extern alias VSTestAdapter; + using System; using System.Collections.Generic; using System.Linq; using Xunit; using Xunit.Runner.VisualStudio; +using Constants = VSTestAdapter.Xunit.Runner.VisualStudio.Constants; +using TestPlatformContext = VSTestAdapter.Xunit.Runner.VisualStudio.TestPlatformContext; +using VsDiscoverySink = VSTestAdapter.Xunit.Runner.VisualStudio.VsDiscoverySink; +using VsTestRunner = VSTestAdapter.Xunit.Runner.VisualStudio.VsTestRunner; public class VsDiscoverySinkTests { @@ -45,7 +51,7 @@ public void StandardData( Assert.NotNull(vsTestCase); - // Standard VSTest properties + // Standard VSTest propertiesgi Assert.Equal("/source/file.cs", vsTestCase.CodeFilePath); Assert.Equal("test-case-display-name", vsTestCase.DisplayName); Assert.Equal(Constants.ExecutorUri, vsTestCase.ExecutorUri.OriginalString); diff --git a/test/test.xunit.runner.visualstudio/TestCaseFilterTests.cs b/test/test.xunit.runner.visualstudio/TestCaseFilterTests.cs index b7caa5f..789f35c 100644 --- a/test/test.xunit.runner.visualstudio/TestCaseFilterTests.cs +++ b/test/test.xunit.runner.visualstudio/TestCaseFilterTests.cs @@ -1,3 +1,5 @@ +extern alias VSTestAdapter; + using System; using System.Collections.Generic; using System.Diagnostics; @@ -7,8 +9,9 @@ using Microsoft.VisualStudio.TestPlatform.ObjectModel.Logging; using NSubstitute; using Xunit; -using Xunit.Runner.VisualStudio; -using Constants = Xunit.Runner.VisualStudio.Constants; +using Constants = VSTestAdapter.Xunit.Runner.VisualStudio.Constants; +using LoggerHelper = VSTestAdapter.Xunit.Runner.VisualStudio.LoggerHelper; +using TestCaseFilter = VSTestAdapter.Xunit.Runner.VisualStudio.TestCaseFilter; public class TestCaseFilterTests { diff --git a/test/test.xunit.runner.visualstudio/Utility/SpyLoggerHelper.cs b/test/test.xunit.runner.visualstudio/Utility/SpyLoggerHelper.cs index fe934cb..0783671 100644 --- a/test/test.xunit.runner.visualstudio/Utility/SpyLoggerHelper.cs +++ b/test/test.xunit.runner.visualstudio/Utility/SpyLoggerHelper.cs @@ -1,10 +1,13 @@ +extern alias VSTestAdapter; + using System.Collections.Generic; using System.Diagnostics; using Microsoft.VisualStudio.TestPlatform.ObjectModel.Logging; +using LoggerHelper = VSTestAdapter.Xunit.Runner.VisualStudio.LoggerHelper; namespace Xunit.Runner.VisualStudio; -public class SpyLoggerHelper(SpyMessageLogger logger, Stopwatch stopwatch) : +internal class SpyLoggerHelper(SpyMessageLogger logger, Stopwatch stopwatch) : LoggerHelper(logger, stopwatch) { public IReadOnlyCollection Messages => logger.Messages; diff --git a/test/test.xunit.runner.visualstudio/VsTestRunnerTests.cs b/test/test.xunit.runner.visualstudio/VsTestRunnerTests.cs index b144a06..e6a956e 100644 --- a/test/test.xunit.runner.visualstudio/VsTestRunnerTests.cs +++ b/test/test.xunit.runner.visualstudio/VsTestRunnerTests.cs @@ -1,7 +1,9 @@ +extern alias VSTestAdapter; + using System.ComponentModel; using System.Reflection; using Xunit; -using Xunit.Runner.VisualStudio; +using VsTestRunner = VSTestAdapter.Xunit.Runner.VisualStudio.VsTestRunner; public class VsTestRunnerTests { diff --git a/test/test.xunit.runner.visualstudio/test.xunit.runner.visualstudio.csproj b/test/test.xunit.runner.visualstudio/test.xunit.runner.visualstudio.csproj index 15b1164..9a6907c 100644 --- a/test/test.xunit.runner.visualstudio/test.xunit.runner.visualstudio.csproj +++ b/test/test.xunit.runner.visualstudio/test.xunit.runner.visualstudio.csproj @@ -15,7 +15,9 @@ - + + VSTestAdapter +