<commit_before>﻿using System;
using System.Threading.Tasks;
using NServiceBus;
using SFA.DAS.Reservations.Messages;

namespace SFA.DAS.EAS.Portal.Worker.TestHarness.Scenarios
{
    public class PublishReserveFundingAddedEvents
    {
        private readonly IMessageSession _messageSession;

        public PublishReserveFundingAddedEvents(IMessageSession messageSession)
        {
            _messageSession = messageSession;
        }

        public async Task Run()
        {
            const long accountId = 1337L;
            const long accountLegalEntityId1 = 420L;
            const string legalEntityName1 = "Fishy Fingers Ltd";
            const long accountLegalEntityId2 = 8008135L;
            const string legalEntityName2 = "<NAME>'s Fish Emporium Ltd";

            await _messageSession.Publish(new ReservationCreatedEvent(
                new Guid("11111111-ECFD-4D28-BB76-2DA9ECE6AD2C"),
                accountLegalEntityId1, legalEntityName1, "3",
                new DateTime(2020, 1, 1),
                "Fish Monger, Level 3 (Standard)", new DateTime(2021, 1, 1),
                DateTime.UtcNow, accountId));

            // another reservation, same account, same legal entity
            await _messageSession.Publish(new ReservationCreatedEvent(
                new Guid("22222222-ECFD-4D28-BB76-2DA9ECE6AD2C"),
                accountLegalEntityId1, legalEntityName1, "4",
                new DateTime(2020, 2, 1),
                "Fish Monger, Level 4 (Standard)", new DateTime(2021, 2, 1),
                DateTime.UtcNow, accountId));
            
            // another reservation, same account, different legal entity
            await _messageSession.Publish(new ReservationCreatedEvent(
                new Guid("33333333-ECFD-4D28-BB76-2DA9ECE6AD2C"),
                accountLegalEntityId2, legalEntityName2, "2",
                new DateTime(2020, 2, 1),
                "Fish Monger, Level 2 (Standard)", new DateTime(2021, 2, 1),
                DateTime.UtcNow, accountId));
        }
    }
}<commit_msg>log when publish events in worker test harness<commit_after>﻿using System;
using System.Threading.Tasks;
using NServiceBus;
using SFA.DAS.Reservations.Messages;

namespace SFA.DAS.EAS.Portal.Worker.TestHarness.Scenarios
{
    public class PublishReserveFundingAddedEvents
    {
        private readonly IMessageSession _messageSession;

        public PublishReserveFundingAddedEvents(IMessageSession messageSession)
        {
            _messageSession = messageSession;
        }

        public async Task Run()
        {
            const long accountId = 1337L;
            const long accountLegalEntityId1 = 420L;
            const string legalEntityName1 = "Fishy Fingers Ltd";
            const long accountLegalEntityId2 = 8008135L;
            const string legalEntityName2 = "<NAME> Fish Emporium Ltd";

            await _messageSession.Publish(new ReservationCreatedEvent(
                new Guid("11111111-ECFD-4D28-BB76-2DA9ECE6AD2C"),
                accountLegalEntityId1, legalEntityName1, "3",
                new DateTime(2020, 1, 1),
                "Fish Monger, Level 3 (Standard)", new DateTime(2021, 1, 1),
                DateTime.UtcNow, accountId));

            Console.WriteLine("Published ReservationCreatedEvent. Id: 11111111-ECFD-4D28-BB76-2DA9ECE6AD2C");
            
            // another reservation, same account, same legal entity
            await _messageSession.Publish(new ReservationCreatedEvent(
                new Guid("22222222-ECFD-4D28-BB76-2DA9ECE6AD2C"),
                accountLegalEntityId1, legalEntityName1, "4",
                new DateTime(2020, 2, 1),
                "Fish Monger, Level 4 (Standard)", new DateTime(2021, 2, 1),
                DateTime.UtcNow, accountId));

            Console.WriteLine("Published ReservationCreatedEvent. Id: 22222222-ECFD-4D28-BB76-2DA9ECE6AD2C");

            // another reservation, same account, different legal entity
            await _messageSession.Publish(new ReservationCreatedEvent(
                new Guid("33333333-ECFD-4D28-BB76-2DA9ECE6AD2C"),
                accountLegalEntityId2, legalEntityName2, "2",
                new DateTime(2020, 2, 1),
                "Fish Monger, Level 2 (Standard)", new DateTime(2021, 2, 1),
                DateTime.UtcNow, accountId));
            
            Console.WriteLine("Published ReservationCreatedEvent. Id: 33333333-ECFD-4D28-BB76-2DA9ECE6AD2C");
        }
    }
}
{'fraction_non_alphanumeric': 0.0851586946803755, 'fraction_numerical': 0.06370138578453285, 'mean_word_length': 2.268809349890431, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 9, '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': '4828032', 'n_tokens_mistral': 1470, 'n_tokens_neox': 1235, 'n_words': 287}