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

using System;
using FluentAssertions;
using log4net;
using log4net.Config;
using Xunit;
using Xunit.Abstractions;

namespace Server.Host.Tests
{
    public class ServerHostTests : IClassFixture<ServerHostTestFixture>, IDisposable
    {
        private readonly ITestOutputHelper output;

        [Fact]
        [Trait("Category","BVT")]
        public void LoadServerInNewAppDomain()
        {
            string serverName = "LoadServerInNewAppDomain"; // TestContext.TestName;

            ServerHostHandle<TestServer.Server> serverHostHandle = ServerHost
                .LoadServerInNewAppDomain<TestServer.Server>(serverName);

            serverHostHandle.Should().NotBeNull("Null ServerHostHandle returned.");
            serverHostHandle.ServerName.Should().Be(serverName, "ServerHostHandle.ServerName");
            serverHostHandle.AppDomain.Should().NotBeNull("Null ServerHostHandle.AppDomain returned.");
            serverHostHandle.Server.Should().NotBeNull("Null ServerHostHandle.Server returned.");
            serverHostHandle.Server.Should().BeOfType<TestServer.Server>("Server instance type.");
        }

        #region Test Initialization / Cleanup methods

        // TestInitialize
        public ServerHostTests(ITestOutputHelper output, ServerHostTestFixture fixture)
        {
            this.output = output;
            output.WriteLine("TestInitialize");

            output.WriteLine("Fixture = {0}", fixture);

            output.WriteLine("Current directory = {0}", Environment.CurrentDirectory);
        }

        // TestCleanup
        public void Dispose()
        {
            output.WriteLine("TestCleanup");

            output.WriteLine("UnloadAllServers");
            ServerHost.UnloadAllServers();
        }
        #endregion
    }

    public class ServerHostTestFixture : IDisposable
    {
        internal static readonly ILog log = LogManager.GetLogger(typeof(ServerHostTestFixture));

        // ClassInitialize
        public ServerHostTestFixture()
        {
            // Set up the log4net configuration.
            BasicConfigurator.Configure();

            log.Info("ServerHostTestFixture - Initialize");
        }

        // ClassCleanup
        public void Dispose()
        {
            log.Info("ServerHostTestFixture - Dispose");
        }
    }
}<commit_msg>Provide more context in activity log messages.<commit_after>﻿// Copyright (c) <NAME>. All rights reserved.

using System;
using FluentAssertions;
using log4net;
using log4net.Config;
using Xunit;
using Xunit.Abstractions;

namespace Server.Host.Tests
{
    public class ServerHostTests : IClassFixture<ServerHostTestFixture>, IDisposable
    {
        private readonly ITestOutputHelper output;
        private readonly string className;

        [Fact]
        [Trait("Category","BVT")]
        public void LoadServerInNewAppDomain()
        {
            string testName = "LoadServerInNewAppDomain"; // TestContext.TestName;

            ServerHostHandle<TestServer.Server> serverHostHandle = ServerHost
                .LoadServerInNewAppDomain<TestServer.Server>(testName);

            serverHostHandle.Should().NotBeNull("Null ServerHostHandle returned.");
            serverHostHandle.ServerName.Should().Be(testName, "ServerHostHandle.ServerName");
            serverHostHandle.AppDomain.Should().NotBeNull("Null ServerHostHandle.AppDomain returned.");
            serverHostHandle.Server.Should().NotBeNull("Null ServerHostHandle.Server returned.");
            serverHostHandle.Server.Should().BeOfType<TestServer.Server>("Server instance type.");
        }

        #region Test Initialization / Cleanup methods

        // TestInitialize
        public ServerHostTests(ITestOutputHelper output, ServerHostTestFixture fixture)
        {
            this.output = output;
            this.className = GetType().Name;
            output.WriteLine("{0} TestInitialize", className);

            output.WriteLine("{0} Fixture = {1}", className, fixture);

            output.WriteLine("{0} Current directory = {1}", className, Environment.CurrentDirectory);
        }

        // TestCleanup
        public void Dispose()
        {
            output.WriteLine("{0} TestCleanup", className);

            output.WriteLine("{0} UnloadAllServers", className);
            ServerHost.UnloadAllServers();
        }
        #endregion
    }

    public class ServerHostTestFixture : IDisposable
    {
        internal static readonly ILog log = LogManager.GetLogger(typeof(ServerHostTestFixture));

        private readonly string className;

        // ClassInitialize
        public ServerHostTestFixture()
        {
            this.className = GetType().Name;

            // Set up the log4net configuration.
            BasicConfigurator.Configure();

            log.InfoFormat("{0} - Initialize", className);
        }

        // ClassCleanup
        public void Dispose()
        {
            log.InfoFormat("{0} - Dispose", className);
        }
    }
}
{'fraction_non_alphanumeric': 0.09806247528667457, 'fraction_numerical': 0.003361012257809411, 'mean_word_length': 2.5229805013927575, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, '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': '2325061', 'n_tokens_mistral': 1281, 'n_tokens_neox': 1255, 'n_words': 256}