<commit_before>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NUnit.Framework;
using System.Reflection;
using System.Diagnostics;
using Spring.Context.Config;
using Spring.Context.Support;

namespace Spring.Objects.Factory.Support
{
    [TestFixture]
    public class AssemblyScanningExtensionMethodsTests
    {
        [Test]
        public void Integration_Scenario_With_Defaults()
        {
            GenericApplicationContext context = new GenericApplicationContext();
            context.ScanAssembliesAndRegisterDefinitions();// (assy => assy.GetTypes().Any(type => type.FullName.Contains("SomeType")));
            context.Refresh();

            AssertExpectedObjectsAreRegisteredWith(context);
        }

        [Test]
        public void Integration_Scenario_With_Filtering_Example()
        {
            GenericApplicationContext context = new GenericApplicationContext();
            context.ScanAssembliesAndRegisterDefinitions(assy => assy.GetTypes().Any(type => type.FullName.Contains(typeof(MarkerTypeForScannerToFind).Name)));
            context.Refresh();

            AssertExpectedObjectsAreRegisteredWith(context);
        }

        private static void AssertExpectedObjectsAreRegisteredWith(GenericApplicationContext context)
        {
            Assert.That(context.DefaultListableObjectFactory.ObjectDefinitionCount, Is.EqualTo(13));
        }
        [Test]
        public void Integration_Scenario_With_Complex_Filtering_Example()
        {
            GenericApplicationContext context = new GenericApplicationContext();
            context.ScanAssembliesAndRegisterDefinitions(fn => fn.StartsWith("Spring."), assy => assy.GetTypes().Any(type => type.FullName.Contains(typeof(MarkerTypeForScannerToFind).Name)));
            context.Refresh();

            AssertExpectedObjectsAreRegisteredWith(context);
        }
    }


    public class MarkerTypeForScannerToFind
    {

    }
}
<commit_msg>Cosmetic mods to improve test code clarity of intent<commit_after>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NUnit.Framework;
using System.Reflection;
using System.Diagnostics;
using Spring.Context.Config;
using Spring.Context.Support;

namespace Spring.Objects.Factory.Support
{
    [TestFixture]
    public class AssemblyScanningExtensionMethodsTests
    {
        [Test]
        public void Integration_Scenario_With_Assembly_Filename_And_Assembly_Metadata_Filtering()
        {
            GenericApplicationContext context = new GenericApplicationContext();
            context.ScanAssembliesAndRegisterDefinitions(fn => fn.StartsWith("Spring."), assy => assy.GetTypes().Any(type => type.FullName.Contains(typeof(MarkerTypeForScannerToFind).Name)));
            context.Refresh();

            AssertExpectedObjectsAreRegisteredWith(context);
        }

        [Test]
        public void Integration_Scenario_With_Assembly_Metadata_Filtering()
        {
            GenericApplicationContext context = new GenericApplicationContext();
            context.ScanAssembliesAndRegisterDefinitions(assy => assy.GetTypes().Any(type => type.FullName.Contains(typeof(MarkerTypeForScannerToFind).Name)));
            context.Refresh();

            AssertExpectedObjectsAreRegisteredWith(context);
        }

        [Test]
        public void Integration_Scenario_With_Default_of_No_Filtering()
        {
            GenericApplicationContext context = new GenericApplicationContext();
            context.ScanAssembliesAndRegisterDefinitions();
            context.Refresh();

            AssertExpectedObjectsAreRegisteredWith(context);
        }

        private static void AssertExpectedObjectsAreRegisteredWith(GenericApplicationContext context)
        {
            Assert.That(context.DefaultListableObjectFactory.ObjectDefinitionCount, Is.EqualTo(13));
        }

    }

    public class MarkerTypeForScannerToFind
    {

    }
}

{'fraction_non_alphanumeric': 0.08122699386503067, 'fraction_numerical': 0.00098159509202454, 'mean_word_length': 2.98825831702544, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 15, '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': '5716557', 'n_tokens_mistral': 1013, 'n_tokens_neox': 981, 'n_words': 157}