<commit_before>﻿namespace SFA.DAS.ProviderApprenticeshipsService.Web.Tests.Orchestrators
{
    using System.Threading.Tasks;

    using MediatR;

    using Moq;

    using NUnit.Framework;

    using Application.Commands.SubmitCommitment;
    using Models.Types;

    using SFA.DAS.Commitments.Api.Types;

    using Web.Orchestrators;

    [TestFixture]
    public class WhenApproveCommitment
    {
        [TestCase(SaveStatus.Save, AgreementStatus.NotAgreed, true)]
        [TestCase(SaveStatus.ApproveAndSend, AgreementStatus.ProviderAgreed, true)]
        [TestCase(SaveStatus.AmendAndSend, AgreementStatus.ProviderAgreed, true)]
        [TestCase(SaveStatus.Approve, AgreementStatus.ProviderAgreed, false)]
        public async Task  CheckStatusUpdate(SaveStatus input, AgreementStatus expectedAgreementStatus, bool expectedCreateTaskBool)
        {
            var mockMediator = new Mock<IMediator>();

            var _sut = new CommitmentOrchestrator(mockMediator.Object, Mock.Of<ICommitmentStatusCalculator>());
            await _sut.ApproveCommitment(1L, 2L, input);

            mockMediator.Verify(m => m
                .SendAsync(It.Is<SubmitCommitmentCommand>(
                    p => p.ProviderId == 1L &&
                    p.CommitmentId == 2L &&
                    p.Message == string.Empty &&
                    p.AgreementStatus == expectedAgreementStatus &&
                    p.CreateTask == expectedCreateTaskBool )));
        }
    }
}
<commit_msg>Fixed failing test<commit_after>﻿namespace SFA.DAS.ProviderApprenticeshipsService.Web.Tests.Orchestrators
{
    using System.Threading.Tasks;

    using MediatR;

    using Moq;

    using NUnit.Framework;

    using Application.Commands.SubmitCommitment;
    using Models.Types;

    using SFA.DAS.Commitments.Api.Types;
    using SFA.DAS.ProviderApprenticeshipsService.Domain.Interfaces;

    using Web.Orchestrators;

    [TestFixture]
    public class WhenApproveCommitment
    {
        [TestCase(SaveStatus.Save, AgreementStatus.NotAgreed, true)]
        [TestCase(SaveStatus.ApproveAndSend, AgreementStatus.ProviderAgreed, true)]
        [TestCase(SaveStatus.AmendAndSend, AgreementStatus.ProviderAgreed, true)]
        [TestCase(SaveStatus.Approve, AgreementStatus.ProviderAgreed, false)]
        public async Task  CheckStatusUpdate(SaveStatus input, AgreementStatus expectedAgreementStatus, bool expectedCreateTaskBool)
        {
            var mockMediator = new Mock<IMediator>();
            var mockHashingService = new Mock<IHashingService>();
            mockHashingService.Setup(m => m.DecodeValue("ABBA99")).Returns(2L);

            var _sut = new CommitmentOrchestrator(mockMediator.Object, Mock.Of<ICommitmentStatusCalculator>(), mockHashingService.Object);
            await _sut.ApproveCommitment(1L, "ABBA99", input);

            mockMediator.Verify(m => m
                .SendAsync(It.Is<SubmitCommitmentCommand>(
                    p => p.ProviderId == 1L &&
                    p.CommitmentId == 2L &&
                    p.Message == string.Empty &&
                    p.AgreementStatus == expectedAgreementStatus &&
                    p.CreateTask == expectedCreateTaskBool )));
        }
    }
}

{'fraction_non_alphanumeric': 0.09308841843088418, 'fraction_numerical': 0.0037359900373599006, 'mean_word_length': 2.7447552447552446, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 15, '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': '835190', 'n_tokens_mistral': 925, 'n_tokens_neox': 895, 'n_words': 151}