Exemplo n.º 1
0
 void Given(DealerManifestDownloaded e)
 {
     foreach (var asset in e.Assets)
     {
         _pendingAssetIds.Add(asset.Id);
     }
 }
Exemplo n.º 2
0
        void Given(DealerManifestDownloaded e)
        {
            foreach (var asset in e.Assets)
            {
                _fileNamesByAssetId[asset.Id] = asset.File.Name;
            }

            if (!_campaignsByDealerId.TryGetValue(e.DealerId, out var campaignsById))
            {
                campaignsById = new Dictionary <Id, DealerManifest.Campaign>();

                _campaignsByDealerId[e.DealerId] = campaignsById;
            }

            foreach (var added in e.AddedCampaigns)
            {
                campaignsById.Add(added.Id, added);
            }

            foreach (var updated in e.UpdatedCampaigns)
            {
                campaignsById[updated.Id] = updated;
            }

            foreach (var removedId in e.RemovedCampaignIds)
            {
                campaignsById.Remove(removedId);
            }
        }
Exemplo n.º 3
0
        void Given(DealerManifestDownloaded e)
        {
            foreach (var added in e.AddedCampaigns)
            {
                _campaignsById.Add(added.Id, added);
            }

            foreach (var updated in e.UpdatedCampaigns)
            {
                _campaignsById[updated.Id] = updated;
            }

            foreach (var removedId in e.RemovedCampaignIds)
            {
                _campaignsById.Remove(removedId);
            }
        }
Exemplo n.º 4
0
 static Id Route(DealerManifestDownloaded e) => e.DealerId;
Exemplo n.º 5
0
        //
        // When
        //

        void When(DealerManifestDownloaded e) =>
        CheckFinished();
Exemplo n.º 6
0
 void Given(DealerManifestDownloaded e) =>
 _pendingDealerIds.Remove(e.DealerId);
Exemplo n.º 7
0
 void Given(DealerManifestDownloaded e)
 {
     ManifestDownloadError = null;
     CampaignImportError   = null;
 }
Exemplo n.º 8
0
 void Given(DealerManifestDownloaded e) =>
 _asset = e.Assets.First(asset => asset.Id == Id);
Exemplo n.º 9
0
 static Many <Id> RouteFirst(DealerManifestDownloaded e) => e.Assets.ToMany(asset => asset.Id);