<commit_before>﻿// Copyright (c) <NAME>. All rights reserved.

using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using System.IO;
using System.Reflection;
using log4net;

namespace ServerHost
{
    /// <summary>
    /// Data holder class for information related to a hosted in-process test server instance.
    /// </summary>
    /// <typeparam name="TServer">Type of the server.</typeparam>
    public class ServerHostHandle<TServer> 
        where TServer : MarshalByRefObject
    {
        public string ServerName { get; internal set; }
        public TServer Server { get; internal set; }
        public AppDomain AppDomain { get; internal set; }
    }

    /// <summary>
    /// A test framework class for loading server instances into individual AppDomains in current process.
    /// </summary>
    /// <remarks>Uses <c>log4net</c> for logging.</remarks>
    /// <see cref="http://logging.apache.org/log4net/"/>
    public static class ServerTestHost
    {
        private static readonly ILog log = LogManager.GetLogger("ServerTestHost");

        private static readonly List<AppDomain> loadedAppDomains = new List<AppDomain>();

        /// <summary>
        /// Create a new AppDomain and load a new instance of a server class into that AppDomain.
        /// </summary>
        /// <typeparam name="TServer">Type of the server.</typeparam>
        /// <param name="serverName">Name of this server instance.</param>
        /// <returns><c>ServerHostHandle</c> object containing metadata about the loaded server instance.</returns>
        /// <remarks>
        /// The <c>serverName</c> will be used for the name of the newly created AppDomain to host this new server instance.
        /// Multiple copies of a server can be created if they arer each given a different server name.
        /// </remarks>
        public static ServerHostHandle<TServer> LoadServerInNewAppDomain<TServer>(
            string serverName) <commit_msg>Update some missing / bad API doc-comments.<commit_after>﻿// Copyright (c) <NAME>. All rights reserved.

using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using System.IO;
using System.Reflection;
using log4net;

namespace ServerHost
{
    /// <summary>
    /// Data holder class for information related to a hosted in-process test server instance.
    /// </summary>
    /// <typeparam name="TServer">Type of the server.</typeparam>
    public class ServerHostHandle<TServer> 
        where TServer : MarshalByRefObject
    {
        /// <summary> The name of this server. </summary>
        public string ServerName { get; internal set; }
        /// <summary> Reference to the Server instance in the hoster AppDomain. </summary>
        public TServer Server { get; internal set; }
        /// <summary> Reference to the AppDomain this server is running in. </summary>
        public AppDomain AppDomain { get; internal set; }
    }

    /// <summary>
    /// A test framework class for loading server instances into individual AppDomains in current process.
    /// </summary>
    /// <remarks>Uses <c>log4net</c> for logging. See: http://logging.apache.org/log4net/</remarks>
    public static class ServerTestHost
    {
        private static readonly ILog log = LogManager.GetLogger("ServerTestHost");

        private static readonly List<AppDomain> loadedAppDomains = new List<AppDomain>();

        /// <summary>
        /// Create a new AppDomain and load a new instance of a server class into that AppDomain.
        /// </summary>
        /// <typeparam name="TServer">Type of the server.</typeparam>
        /// <param name="serverName">Name of this server instance.</param>
        /// <returns><c>ServerHostHandle</c> object containing metadata about the loaded server instance.</returns>
        /// <remarks>
        /// The <c>serverName</c> will be used for the name of the newly created AppDomain to host this new server instance.
        /// Multiple copies of a server can be created if they arer each given a different server name.
        /// </remarks>
        public static ServerHostHandle<TServer> LoadServerInNewAppDomain<TServer>(
            string serverName) 
{'fraction_non_alphanumeric': 0.10639793766112023, 'fraction_numerical': 0.0014061401453011485, 'mean_word_length': 2.776991150442478, 'pattern_counts': {'":': 0, '<': 70, '<?xml version=': 0, '>': 70, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2106036', 'n_tokens_mistral': 1081, 'n_tokens_neox': 1080, 'n_words': 410}