<commit_before>﻿//-----------------------------------------------------------------------
// <copyright company="Sherlock">
//     Copyright 2013 Sherlock. Licensed under the Apache License, Version 2.0.
// </copyright>
//-----------------------------------------------------------------------

using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.IO.Abstractions;
using Autofac;
using Nuclei.Communication;
using Nuclei.Diagnostics;
using Sherlock.Executor.Nuclei;
using Sherlock.Shared.Core;
using Sherlock.Shared.Core.Reporting;

namespace Sherlock.Executor
{
    internal static class DependencyInjection
    {
        private static UploadReportFilesForTestStep BuildReportFileUploader(IComponentContext context, string storageDirectory, EndpointId hostId)
        {
            UploadReportFilesForTestStep uploader =
                (stepIndex, filesToUpload) =>
                {
                    var path = Path.Combine(
                        storageDirectory,
                        string.Format(
                            CultureInfo.InvariantCulture,
                            "TestStepReport-{0}.zip",
                            stepIndex));
                    var package = context.Resolve<ITestStepPackage>();
                    foreach (var pair in filesToUpload)<commit_msg>Switching to use the TestStepPackage directly instead of trying (unsuccessfully) to resolve it from the container. It would seem a bit pointless to add it to the container while we're in the dependency injection code.<commit_after>﻿//-----------------------------------------------------------------------
// <copyright company="Sherlock">
//     Copyright 2013 Sherlock. Licensed under the Apache License, Version 2.0.
// </copyright>
//-----------------------------------------------------------------------

using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.IO.Abstractions;
using Autofac;
using Nuclei.Communication;
using Nuclei.Diagnostics;
using Sherlock.Executor.Nuclei;
using Sherlock.Shared.Core;
using Sherlock.Shared.Core.Reporting;

namespace Sherlock.Executor
{
    internal static class DependencyInjection
    {
        private static UploadReportFilesForTestStep BuildReportFileUploader(IComponentContext context, string storageDirectory, EndpointId hostId)
        {
            UploadReportFilesForTestStep uploader =
                (stepIndex, filesToUpload) =>
                {
                    if (filesToUpload.Count == 0)
                    {
                        return;
                    }

                    var path = Path.Combine(
                        storageDirectory,
                        string.Format(
                            CultureInfo.InvariantCulture,
                            "TestStepReport-{0}.zip",
                            stepIndex));
                    var package = new TestStepPackage(stepIndex);
                    foreach (var pair in filesToUpload)
{'fraction_non_alphanumeric': 0.15844838921762, 'fraction_numerical': 0.004930966469428008, 'mean_word_length': 1.5744500846023688, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 10, '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': '2746428', 'n_tokens_mistral': 699, 'n_tokens_neox': 650, 'n_words': 180}