<commit_before>using System.Diagnostics;
using FluentAssertions;
using NEdifis.Attributes;
using NUnit.Framework;

namespace NEdifis.Diagnostics
{
    [TestFixtureFor(typeof(TestTraceListener))]
    // ReSharper disable once InconsistentNaming
    class TestTraceListener_Should
    {
        [Test]
        public void Be_Creatable()
        {
            // lets count the before
            var listenerCount = Trace.Listeners.Count;

            using (var ttl = new TestTraceListener())
            {
                Trace.Listeners.Count.Should().Be(listenerCount + 1);

                Trace.TraceError("here is a message");
                ttl.MessagesFor(TraceLevel.Error).Should().Contain("here is a message");
                ttl.MessagesFor(TraceLevel.Info).Should().NotContain("here is a message");
            }

            // see if it got deregistered
            Trace.Listeners.Count.Should().Be(listenerCount);
        }

        [Test]
        public void Handle_Error_Warn_Information()
        {
            using (var ttl = new TestTraceListener())
            {
                Trace.TraceError("cool error");
                Trace.TraceWarning("awesome warning");
                Trace.TraceInformation("great information");
                Trace.WriteLine("nice debug");

                ttl.MessagesFor(TraceLevel.Error).Should().Contain("cool error");
                ttl.MessagesFor(TraceLevel.Warning).Should().Contain("awesome warning");
                ttl.MessagesFor(TraceLevel.Info).Should().Contain("great information");
                ttl.MessagesFor(TraceLevel.Verbose).Should().BeEmpty(because: "level is set to info by default");
            }
        }

        [Test]
        public void Handle_Debug()
        {
            using (var ttl = new TestTraceListener())
            {
                ttl.ActiveTraceLevel = TraceLevel.Verbose;
                Trace.WriteLine("nice debug");

                ttl.MessagesFor(TraceLevel.Verbose).Should().Contain("nice debug");
            }
        }

        [Test]
        public void Handle_Debug_Using_Debug_Class()
        {<commit_msg>Update TestTraceListener_Should.cs<commit_after>using System.Diagnostics;
using FluentAssertions;
using NEdifis.Attributes;
using NUnit.Framework;

namespace NEdifis.Diagnostics
{
    [TestFixtureFor(typeof(TestTraceListener))]
    // ReSharper disable once InconsistentNaming
    class TestTraceListener_Should
    {
        [Test]
        public void Be_Creatable()
        {
            // lets count the before
            var listenerCount = Trace.Listeners.Count;

            using (var ttl = new TestTraceListener())
            {
                Trace.Listeners.Count.Should().Be(listenerCount + 1);

                Trace.TraceError("here is a message");
                ttl.MessagesFor(TraceLevel.Error).Should().Contain("here is a message");
                ttl.MessagesFor(TraceLevel.Info).Should().NotContain("here is a message");
            }

            // see if it got deregistered
            Trace.Listeners.Count.Should().Be(listenerCount);
        }

        [Test]
        public void Handle_Error_Warn_Information()
        {
            using (var ttl = new TestTraceListener())
            {
                Trace.TraceError("cool error");
                Trace.TraceWarning("awesome warning");
                Trace.TraceInformation("great information");
                Trace.WriteLine("nice debug");

                ttl.MessagesFor(TraceLevel.Error).Should().Contain("cool error");
                ttl.MessagesFor(TraceLevel.Warning).Should().Contain("awesome warning");
                ttl.MessagesFor(TraceLevel.Info).Should().Contain("great information");
                ttl.MessagesFor(TraceLevel.Verbose).Should().BeEmpty(because: "level is set to info by default");
            }
        }

        [Test]
        public void Handle_Debug()
        {
            using (var ttl = new TestTraceListener())
            {
                ttl.ActiveTraceLevel = TraceLevel.Verbose;
                Trace.WriteLine("nice debug");
#if DEBUG
                ttl.MessagesFor(TraceLevel.Verbose).Should().Contain("nice debug");
#else
                ttl.MessagesFor(TraceLevel.Verbose).Should().BeEmpty();
#endif
            }
        }

        [Test]
        public void Handle_Debug_Using_Debug_Class()
        {
{'fraction_non_alphanumeric': 0.10582857142857142, 'fraction_numerical': 0.00045714285714285713, 'mean_word_length': 1.9708078750848608, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '1879864', 'n_tokens_mistral': 1158, 'n_tokens_neox': 1107, 'n_words': 212}