Beispiel #1
0
 private static SmoothSponsorshipRestrictionLimits AllCompetitorsWithUnlimitedAvailibility(SmoothSponsorshipRunningTotals input)
 {
     return(new SmoothSponsorshipRestrictionLimits
     {
         AvailabilitiesForCompetitors = input
                                        .GetAllCompetitors()
                                        .ToDictionary(x => x, _ => double.MaxValue)
     });
 }
        internal void GivenTheProductsAreAssignedToClashCodesAndAdvertiserIdentifierWhenTheGetAllCompetitorsIsCalled_ThenAListOfAllUniqueProductsIsReturned()
        {
            var runningTotal = new SmoothSponsorshipRunningTotals();

            runningTotal.AddCompetitorToClashCode("p1", "c1");
            runningTotal.AddCompetitorToClashCode("p2", "c1");
            runningTotal.AddCompetitorToClashCode("p1", "c2");
            runningTotal.AddCompetitorToAdvertiserIdentifier("p1", "a1");
            runningTotal.AddCompetitorToAdvertiserIdentifier("p2", "a1");
            runningTotal.AddCompetitorToAdvertiserIdentifier("p1", "a2");
            runningTotal.AddCompetitorToAdvertiserIdentifier("p3", "a3");

            var competitors = runningTotal.GetAllCompetitors();

            Assert.Equal(new ProductExternalReference[] { "p1", "p2", "p3" }, competitors);
        }