<commit_before>﻿using System.Collections;
using System.Collections.Generic;
using System.Linq;
using AutoMapper;
using Esfa.Vacancy.Api.Types;
using Esfa.Vacancy.Register.Api.App_Start;
using Esfa.Vacancy.Register.Application.Queries.SearchApprenticeshipVacancies;
using FluentAssertions;
using NUnit.Framework;

namespace Esfa.Vacancy.Register.UnitTests.SearchApprenticeship.Api.GivenSearchApprenticeshipParameters
{
    [TestFixture]
    public class AndFrameworkCodes
    {
        [SetUp]
        public void Setup()
        {
            AutoMapperConfig.Configure();
        }

        [TestCaseSource(nameof(TestCases))]
        public IEnumerable<string> WhenValidInput_ThenReturnMappedRequest(string frameworkCodes)
        {
            var parameters = new SearchApprenticeshipParameters {FrameworkCodes = frameworkCodes};

            return Mapper
                .Map<SearchApprenticeshipVacanciesRequest>(parameters)
                .FrameworkCodes;
        }

        private static List<TestCaseData> TestCases => new List<TestCaseData>
        {
            new TestCaseData("1")
            .Returns(new[]{"1"})
            .SetName("One or more delimeted values are acceptable"),
            new TestCaseData("1,2")
            .Returns(new[]{"1","2"})
            .SetName("Each number should be delimeted by comma")
        };
    }
}<commit_msg>RA-1232 tidied up namespaces for mapper config.<commit_after>﻿using System.Collections.Generic;
using AutoMapper;
using Esfa.Vacancy.Api.Types;
using Esfa.Vacancy.Register.Api;
using Esfa.Vacancy.Register.Application.Queries.SearchApprenticeshipVacancies;
using NUnit.Framework;

namespace Esfa.Vacancy.Register.UnitTests.SearchApprenticeship.Api.GivenSearchApprenticeshipParameters
{
    [TestFixture]
    public class AndFrameworkCodes
    {
        [SetUp]
        public void Setup()
        {
            AutoMapperConfig.Configure();
        }

        [TestCaseSource(nameof(TestCases))]
        public IEnumerable<string> WhenValidInput_ThenReturnMappedRequest(string frameworkCodes)
        {
            var parameters = new SearchApprenticeshipParameters {FrameworkCodes = frameworkCodes};

            return Mapper
                .Map<SearchApprenticeshipVacanciesRequest>(parameters)
                .FrameworkCodes;
        }

        private static List<TestCaseData> TestCases => new List<TestCaseData>
        {
            new TestCaseData("1")
            .Returns(new[]{"1"})
            .SetName("One or more delimeted values are acceptable"),
            new TestCaseData("1,2, 23lkk")
            .Returns(new[]{"1","2", " 23lkk"})
            .SetName("Each value should be delimeted by comma")
        };
    }
}
{'fraction_non_alphanumeric': 0.09309198374584411, 'fraction_numerical': 0.007388252678241596, 'mean_word_length': 2.7455048409405256, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 13, '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': '5837743', 'n_tokens_mistral': 773, 'n_tokens_neox': 758, 'n_words': 142}