<commit_before>﻿namespace Jwc.Experiment.AutoFixture
{
    using System;
    using System.Linq;
    using Ploeh.AutoFixture;
    using Ploeh.AutoFixture.Xunit;

    public class TestParametersCustomization : ICustomization
    {
        private readonly ITestMethodContext testMethodContext;

        public TestParametersCustomization(ITestMethodContext testMethodContext)
        {
            if (testMethodContext == null)
                throw new ArgumentNullException("testMethodContext");

            this.testMethodContext = testMethodContext;
        }

        public ITestMethodContext TestMethodContext
        {
            get { return this.testMethodContext; }
        }

        public void Customize(IFixture fixture)
        {
            if (fixture == null)
                throw new ArgumentNullException("fixture");

            var customizations = this.testMethodContext.ActualMethod.GetParameters()
                .SelectMany(p =>
                    p.GetCustomAttributes(typeof(CustomizeAttribute), false)
                    .Cast<CustomizeAttribute>()
                    .Select(c => c.GetCustomization(p)))
                .ToArray();

            fixture.Customize(new CompositeCustomization(customizations));
        }
    }
}<commit_msg>docs: Documented TestParametersCustomization.<commit_after>﻿namespace Jwc.Experiment.AutoFixture
{
    using System;
    using System.Linq;
    using Ploeh.AutoFixture;
    using Ploeh.AutoFixture.Xunit;

    /// <summary>
    /// Represents a customization to support <see cref="CustomizeAttribute"/>(s).
    /// </summary>
    public class TestParametersCustomization : ICustomization
    {
        private readonly ITestMethodContext testMethodContext;

        /// <summary>
        /// Initializes a new instance of the <see cref="TestParametersCustomization"/> class.
        /// </summary>
        /// <param name="testMethodContext">
        /// The test method context.
        /// </param>
        public TestParametersCustomization(ITestMethodContext testMethodContext)
        {
            if (testMethodContext == null)
                throw new ArgumentNullException("testMethodContext");

            this.testMethodContext = testMethodContext;
        }

        /// <summary>
        /// Gets the test method context.
        /// </summary>
        public ITestMethodContext TestMethodContext
        {
            get { return this.testMethodContext; }
        }

        /// <summary>
        /// Customizes the specified fixture.
        /// </summary>
        /// <param name="fixture">
        /// The fixture to customize.
        /// </param>
        public void Customize(IFixture fixture)
        {
            if (fixture == null)
                throw new ArgumentNullException("fixture");

            var customizations = this.testMethodContext.ActualMethod.GetParameters()
                .SelectMany(p =>
                    p.GetCustomAttributes(typeof(CustomizeAttribute), false)
                    .Cast<CustomizeAttribute>()
                    .Select(c => c.GetCustomization(p)))
                .ToArray();

            fixture.Customize(new CompositeCustomization(customizations));
        }
    }
}
{'fraction_non_alphanumeric': 0.09393468118195956, 'fraction_numerical': 0.0, 'mean_word_length': 1.9860724233983287, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 23, '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': '3831599', 'n_tokens_mistral': 796, 'n_tokens_neox': 769, 'n_words': 163}