private void onAgeBandReceived(IGetAgeBandResult result)
 {
     if (result.Success)
     {
         ageBand = result.AgeBand;
     }
     else
     {
         IntegrationTest.Fail("AgeBand could not be retrieved.");
     }
 }
        private void FindMatches(IAgeBand ageBand, GuestApiErrorCollection errors, Action <BuildLegalMarketingErrorsResult> successCallback, Action failureCallback)
        {
            IEnumerable <GuestApiError> source  = errors.errors.Where((GuestApiError error) => error.code == "PPU_MARKETING");
            IEnumerable <GuestApiError> source2 = errors.errors.Where((GuestApiError error) => error.code == "PPU_LEGAL");

            IMarketingItem[] array  = source.Select((GuestApiError error) => ageBand.Marketing.FirstOrDefault((IMarketingItem item) => item.Id == error.inputName)).ToArray();
            ILegalDocument[] array2 = source2.Select((GuestApiError error) => ageBand.LegalDocuments.FirstOrDefault((ILegalDocument item) => item.Id == error.inputName)).ToArray();
            if (array.Any((IMarketingItem item) => item == null) || array2.Any((ILegalDocument item) => item == null))
            {
                failureCallback();
            }
            else
            {
                successCallback(new BuildLegalMarketingErrorsResult(array2, array));
            }
        }
    private static void HandleRequestSuccess(SiteConfigurationData siteConfig, ConfigurationAgeBand configurationAgeBand, string configurationAgeBandKey, bool registration, IList <RegistrationText> legalTexts, Action <IGetAgeBandResult> callback)
    {
        IAgeBand ageBand = CreateAgeBand(siteConfig, configurationAgeBand, configurationAgeBandKey, registration, legalTexts);

        callback(new GetAgeBandResult(ageBand != null, ageBand));
    }
Exemple #4
0
 public GetAgeBandResult(bool success, IAgeBand ageBand)
 {
     Success = success;
     AgeBand = ageBand;
 }