<commit_before>﻿namespace ImageProcessor.Plugins.Effects.Tests
{
    using System;
    using System.Drawing;
    using System.IO;
    using Xunit;
    using FluentAssertions;

    public class ColorBalanceTests
    {
        [Fact]
        public void ColorBalance_processes_image()
        {
            foreach (string file in Directory.GetFiles(@".\img"))
            {
                // arrange
                using (ImageFactory factory = new ImageFactory())
                {
                    factory.Load(file);

                    ColorBalance processor = new ColorBalance();
                    processor.DynamicParameter = new ColorBalanceParameters();

                    // act
                    Action act = () =>
                        {
                            Image img = processor.ProcessImage(factory);
                            img.Save(string.Format(@".\img\{0}_result.jpg", Path.GetFileNameWithoutExtension(file)));
                        };

                    // assert
                    act.ShouldNotThrow("because the image should have been processed without error");
                }
            }
        }
    }
}<commit_msg>Fixes the unit test to fetch the image in the right directory<commit_after>﻿namespace ImageProcessor.Plugins.Effects.Tests
{
    using System;
    using System.Drawing;
    using System.IO;
    using System.Reflection;
    using Xunit;
    using FluentAssertions;

    public class ColorBalanceTests
    {
        [Fact]
        public void ColorBalance_processes_image()
        {
            string imgs = Path.Combine(Path.GetDirectoryName(typeof(ColorBalanceTests).Assembly.Location), "img");

            foreach (string file in Directory.GetFiles(imgs))
            {
                // arrange
                using (ImageFactory factory = new ImageFactory())
                {
                    factory.Load(file);

                    ColorBalance processor = new ColorBalance();
                    processor.DynamicParameter = new ColorBalanceParameters();

                    // act
                    Action act = () =>
                        {
                            Image img = processor.ProcessImage(factory);
                            img.Save(string.Format("{0}/{1}_result.jpg", imgs, Path.GetFileNameWithoutExtension(file)));
                        };

                    // assert
                    act.ShouldNotThrow("because the image should have been processed without error");
                }
            }
        }
    }
}
{'fraction_non_alphanumeric': 0.08425196850393701, 'fraction_numerical': 0.0011811023622047244, 'mean_word_length': 1.3836772983114447, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '2368261', 'n_tokens_mistral': 585, 'n_tokens_neox': 557, 'n_words': 130}