public static void LogsMessage( bool diagnosticMessages, AppDomainOption appDomain, bool shadowCopy, string expectedResult) { var message = TestData.TestAssemblyDiscoveryStarting(diagnosticMessages: diagnosticMessages, appDomain: appDomain, shadowCopy: shadowCopy); var handler = TestableDefaultRunnerReporterMessageHandler.Create(); handler.OnMessage(message); var msg = Assert.Single(handler.Messages); Assert.Equal(expectedResult, msg); }
public static TestAssemblyDiscoveryStarting TestAssemblyDiscoveryStarting( AppDomainOption appDomain = AppDomainOption.Disabled, string assemblyPath = DefaultAssemblyPath, string configFilePath = DefaultConfigFilePath, string targetFramework = DefaultTargetFramework, bool diagnosticMessages = false, bool internalDiagnosticMessages = false, TestMethodDisplay methodDisplay = TestMethodDisplay.ClassAndMethod, TestMethodDisplayOptions methodDisplayOptions = TestMethodDisplayOptions.None, bool preEnumerateTheories = false, bool shadowCopy = false) { var project = new XunitProject(); var assembly = new XunitProjectAssembly(project) { AssemblyFileName = assemblyPath, ConfigFileName = configFilePath, TargetFramework = targetFramework }; // See the ForDiscovery method to see which TestAssemblyConfiguration options are used for discovery var discoveryOptions = _TestFrameworkOptions.ForDiscovery(new TestAssemblyConfiguration { DiagnosticMessages = diagnosticMessages, InternalDiagnosticMessages = internalDiagnosticMessages, MethodDisplay = methodDisplay, MethodDisplayOptions = methodDisplayOptions, PreEnumerateTheories = preEnumerateTheories }); return(new TestAssemblyDiscoveryStarting { AppDomain = appDomain, Assembly = assembly, DiscoveryOptions = discoveryOptions, ShadowCopy = shadowCopy }); }