public async Task ProcessEventsAsync_FailedContract_DoesNotSaveToAzure(ContractProcessResultType resultType)
        {
            // Arrange
            var feed     = GetFeedEntry();
            var expected = GetOneContractProcessResult().ToList();

            expected.First().ContractEvent.BookmarkId = feed.Id;
            expected.First().Result = resultType;

            var actualBackingObject = GetOneContractProcessResult().ToList();

            actualBackingObject.First().Result = resultType;

            ILogger_Setup_LogInformation();
            ILogger_Setup_LogWarning();

            Mock.Get(_deserilizationService)
            .Setup(p => p.DeserializeAsync(It.IsAny <string>()))
            .ReturnsAsync(actualBackingObject)
            .Verifiable();

            var processor = GetContractEventProcessor();

            // Act
            var result = await processor.ProcessEventsAsync(feed);

            // Assert
            result.Should().BeEquivalentTo(expected);
            Verify_All();
        }
 private static IList <ContractProcessResult> GeneratePocoForESIF9999(XmlDocument document = null, ContractProcessResultType result = ContractProcessResultType.Successful)
 => new List <ContractProcessResult>
 {
     new ContractProcessResult
     {
         ContractEvent = new ContractEvent()
         {
             AmendmentType       = ContractAmendmentType.Variation,
             BookmarkId          = Guid.Empty,
             ContractAllocations = new List <ContractAllocation>()
             {
                 new ContractAllocation()
                 {
                     ContractAllocationNumber = "ESF-9999",
                     FundingStreamPeriodCode  = "ESF1420",
                     LEPArea         = "LEP Name",
                     TenderSpecTitle = "SSW"
                 }
             },
             ContractEventXml     = null,
             ContractNumber       = "ESIF-9999",
             ContractPeriodValue  = "1420",
             ContractVersion      = 5,
             EndDate              = new DateTime(2023, 03, 31),
             FundingType          = ContractFundingType.Esf,
             ParentContractNumber = "ESFA-10001",
             ParentStatus         = ContractParentStatus.Draft,
             StartDate            = new DateTime(2019, 04, 01),
             SignedOn             = new DateTime(2019, 03, 01),
             Status = ContractStatus.PublishedToProvider,
             Type   = "Contract for Services",
             UKPRN  = 10000001,
             Value  = 9099922.0000m
         },
         Result      = result,
         ContractXml = document
     }
 };