<commit_before>﻿namespace Fixie.Tests.Execution
{
    using System;
    using Fixie.Cli;
    using Fixie.Execution;

    public class OptionsTests
    {
        public void DemandsAssemblyPathProvided()
        {
            var options = new Options(null);

            Action validate = options.Validate;

            validate.ShouldThrow<CommandLineException>(
                "Missing required test assembly path.");
        }

        public void DemandsAssemblyPathExistsOnDisk()
        {
            var options = new Options("foo.dll");

            Action validate = options.Validate;

            validate.ShouldThrow<CommandLineException>(
                "Specified test assembly does not exist: foo.dll");
        }

        public void DemandsAssemblyPathDirectoryContainsFixie()
        {
            var mscorlib = typeof(string).Assembly.Location;

            var options = new Options(mscorlib);

            Action validate = options.Validate;

            validate.ShouldThrow<CommandLineException>(
                $"Specified assembly {mscorlib} does not appear to be a test assembly. Ensure that it references Fixie.dll and try again.");
        }

        public void AcceptsExistingTestAssemblyPath()
        {
            var assemblyPath = typeof(OptionsTests).Assembly.Location;

            var options = new Options(assemblyPath);

            options.Validate();
        }
    }
}<commit_msg>Test coverage for validation of the --report command line option.<commit_after>﻿namespace Fixie.Tests.Execution
{
    using System;
    using Fixie.Cli;
    using Fixie.Execution;

    public class OptionsTests
    {
        public void DemandsAssemblyPathProvided()
        {
            var options = new Options(null);

            Action validate = options.Validate;

            validate.ShouldThrow<CommandLineException>(
                "Missing required test assembly path.");
        }

        public void DemandsAssemblyPathExistsOnDisk()
        {
            var options = new Options("foo.dll");

            Action validate = options.Validate;

            validate.ShouldThrow<CommandLineException>(
                "Specified test assembly does not exist: foo.dll");
        }

        public void DemandsAssemblyPathDirectoryContainsFixie()
        {
            var mscorlib = typeof(string).Assembly.Location;

            var options = new Options(mscorlib);

            Action validate = options.Validate;

            validate.ShouldThrow<CommandLineException>(
                $"Specified assembly {mscorlib} does not appear to be a test assembly. Ensure that it references Fixie.dll and try again.");
        }

        public void AcceptsExistingTestAssemblyPath()
        {
            var assemblyPath = typeof(OptionsTests).Assembly.Location;

            var options = new Options(assemblyPath);

            options.Validate();
        }

        public void DemandsValidReportFileNameWhenProvided()
        {
            var assemblyPath = typeof(OptionsTests).Assembly.Location;

            var options = new Options(assemblyPath);

            Action validate = options.Validate;

            options.Report = "Report.xml";
            validate();

            options.Report = "\t";
            validate.ShouldThrow<CommandLineException>(
                "Specified report name is invalid: \t");
        }
    }
}
{'fraction_non_alphanumeric': 0.07733333333333334, 'fraction_numerical': 0.0, 'mean_word_length': 2.0223813786929274, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 10, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 1}, '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': '6876255', 'n_tokens_mistral': 811, 'n_tokens_neox': 770, 'n_words': 212}