/// <summary> /// Initializes a new instance of the <see cref="XunitTestFrameworkDiscoverer"/> class. /// </summary> /// <param name="assemblyInfo">The test assembly.</param> /// <param name="sourceProvider">The source information provider.</param> /// <param name="messageAggregator">The message aggregator to receive environmental warnings from.</param> public TestFrameworkDiscoverer(IAssemblyInfo assemblyInfo, ISourceInformationProvider sourceProvider, IMessageAggregator messageAggregator) { Guard.ArgumentNotNull("assemblyInfo", assemblyInfo); Guard.ArgumentNotNull("sourceProvider", sourceProvider); Aggregator = messageAggregator ?? MessageAggregator.Instance; AssemblyInfo = assemblyInfo; DisposalTracker = new DisposalTracker(); SourceProvider = sourceProvider; targetFramework = new Lazy <string>(() => { string result = null; var attrib = AssemblyInfo.GetCustomAttributes(typeof(TargetFrameworkAttribute)).FirstOrDefault(); if (attrib != null) { result = attrib.GetConstructorArguments().Cast <string>().First(); } return(result ?? ""); }); }
/// <inheritdoc/> public ITestFrameworkDiscoverer GetDiscoverer(IAssemblyInfo assemblyInfo) { var discoverer = CreateDiscoverer(assemblyInfo); DisposalTracker.Add(discoverer); return(discoverer); }
/// <inheritdoc/> public ITestFrameworkExecutor GetExecutor(AssemblyName assemblyName) { var executor = CreateExecutor(assemblyName); DisposalTracker.Add(executor); return(executor); }
/// <summary> /// Initializes a new instance of the <see cref="TestFramework"/> class. /// </summary> /// <param name="diagnosticMessageSink">The message sink used to send diagnostic messages</param> protected TestFramework(IMessageSink diagnosticMessageSink) { Guard.ArgumentNotNull("diagnosticMessageSink", diagnosticMessageSink); DiagnosticMessageSink = diagnosticMessageSink; DisposalTracker = new DisposalTracker(); SourceInformationProvider = NullSourceInformationProvider.Instance; }
/// <summary> /// Initializes a new instance of the <see cref="TestFrameworkExecutor{TTestCase}"/> class. /// </summary> /// <param name="assemblyName">Name of the test assembly.</param> /// <param name="sourceInformationProvider">The source line number information provider.</param> protected TestFrameworkExecutor(AssemblyName assemblyName, ISourceInformationProvider sourceInformationProvider) { DisposalTracker = new DisposalTracker(); SourceInformationProvider = sourceInformationProvider; var assembly = Assembly.Load(assemblyName); AssemblyInfo = Reflector.Wrap(assembly); }
/// <inheritdoc/> public async void Dispose() { // We want to immediately return before we call DisconnectAll, since we are in the list // of things that will be disconnected. await Task.Delay(1); ExtensibilityPointFactory.Dispose(); DisposalTracker.Dispose(); LongLivedMarshalByRefObject.DisconnectAll(); }
/// <summary> /// Initializes a new instance of the <see cref="XunitTestFrameworkDiscoverer"/> class. /// </summary> /// <param name="assemblyInfo">The test assembly.</param> /// <param name="sourceProvider">The source information provider.</param> /// <param name="messageAggregator">The message aggregator to receive environmental warnings from.</param> public TestFrameworkDiscoverer(IAssemblyInfo assemblyInfo, ISourceInformationProvider sourceProvider, IMessageAggregator messageAggregator) { Guard.ArgumentNotNull("assemblyInfo", assemblyInfo); Guard.ArgumentNotNull("sourceProvider", sourceProvider); Aggregator = messageAggregator ?? MessageAggregator.Instance; AssemblyInfo = assemblyInfo; DisposalTracker = new DisposalTracker(); SourceProvider = sourceProvider; }
/// <summary> /// Initializes a new instance of the <see cref="TestFrameworkExecutor{TTestCase}"/> class. /// </summary> /// <param name="assemblyName">Name of the test assembly.</param> /// <param name="sourceInformationProvider">The source line number information provider.</param> protected TestFrameworkExecutor(AssemblyName assemblyName, ISourceInformationProvider sourceInformationProvider) { DisposalTracker = new DisposalTracker(); SourceInformationProvider = sourceInformationProvider; #if !WIN8_STORE || WINDOWS_PHONE_APP || WINDOWS_PHONE var assembly = Assembly.Load(assemblyName); #else var assembly = Assembly.Load(assemblyName.Name); #endif AssemblyInfo = Reflector.Wrap(assembly); }
/// <summary> /// Initializes a new instance of the <see cref="TestFrameworkExecutor{TTestCase}"/> class. /// </summary> /// <param name="assemblyName">Name of the test assembly.</param> /// <param name="sourceInformationProvider">The source line number information provider.</param> /// <param name="diagnosticMessageSink">The message sink to report diagnostic messages to.</param> protected TestFrameworkExecutor(AssemblyName assemblyName, ISourceInformationProvider sourceInformationProvider, IMessageSink diagnosticMessageSink) { DisposalTracker = new DisposalTracker(); SourceInformationProvider = sourceInformationProvider; DiagnosticMessageSink = diagnosticMessageSink; var assembly = Assembly.Load(assemblyName); AssemblyInfo = Reflector.Wrap(assembly); }
/// <summary> /// Initializes a new instance of the <see cref="XunitTestFrameworkDiscoverer"/> class. /// </summary> /// <param name="assemblyInfo">The test assembly.</param> /// <param name="sourceProvider">The source information provider.</param> /// <param name="messageAggregator">The message aggregator to receive environmental warnings from.</param> public TestFrameworkDiscoverer(IAssemblyInfo assemblyInfo, ISourceInformationProvider sourceProvider, IMessageAggregator messageAggregator) { Guard.ArgumentNotNull("assemblyInfo", assemblyInfo); Guard.ArgumentNotNull("sourceProvider", sourceProvider); Aggregator = messageAggregator ?? MessageAggregator.Instance; AssemblyInfo = assemblyInfo; DisposalTracker = new DisposalTracker(); SourceProvider = sourceProvider; targetFramework = new Lazy<string>(() => { string result = null; var attrib = AssemblyInfo.GetCustomAttributes(typeof(TargetFrameworkAttribute)).FirstOrDefault(); if (attrib != null) result = attrib.GetConstructorArguments().Cast<string>().First(); return result ?? ""; }); }
/// <inheritdoc/> public void Dispose() { DisposalTracker.Dispose(); }
/// <summary> /// Initializes a new instance of the <see cref="TestFramework"/> class. /// </summary> public TestFramework() { DisposalTracker = new DisposalTracker(); SourceInformationProvider = NullSourceInformationProvider.Instance; }
/// <summary> /// Initializes a new instance of the <see cref="XunitTestFramework"/> class. /// </summary> public TestFramework() { DisposalTracker = new DisposalTracker(); SourceInformationProvider = NullSourceInformationProvider.Instance; }