コード例 #1
0
 protected RemovedSpotFromBreakEventArgs(
     BreakExternalReference breakExternalReference,
     string advertiserIdentifier,
     string clashExternalReference,
     ProductExternalReference productExternalReference,
     bool isSponsor,
     SponsorshipApplicability applicability,
     SponsorshipCalculationType calculationType,
     (SponsorshipRestrictionType type, Duration duration) restrictionType
コード例 #2
0
        public void AssignmentIsNewInstance(string value)
        {
            // Arrange

            // Act
            BreakExternalReference subject = value;

            // Assert
            _ = subject.Should().NotBeSameAs(value, becauseArgs: null);
        }
コード例 #3
0
        public void AssigningAValue(string value)
        {
            // Arrange

            // Act
            BreakExternalReference result = value;

            // Assert
            _ = value.Should().BeEquivalentTo(result, becauseArgs: null);
        }
コード例 #4
0
 /// <summary>
 /// Construct an event argument object for when a spot is added to a break.
 /// </summary>
 /// <param name="productExternalReference">   </param>
 /// <param name="isSponsor">                  </param>
 /// <param name="productAdvertiserIdentifier"></param>
 /// <param name="productClashCode">           </param>
 /// <param name="competitorType">             </param>
 /// <param name="sponsorshipApplicability">
 /// Will be <see langword="null"/> if the spot is for a sponsor.
 /// </param>
 /// <param name="restrictionType">            </param>
 protected AddedSpotToBreakEventArgs(
     BreakExternalReference breakExternalReference,
     ProductExternalReference productExternalReference,
     bool isSponsor,
     string productAdvertiserIdentifier,
     string productClashCode,
     SponsorshipCompetitorType competitorType,
     SponsorshipApplicability sponsorshipApplicability,
     SponsorshipCalculationType calculationType,
     (SponsorshipRestrictionType type, Duration duration) restrictionType)
コード例 #5
0
        public static Recommendation ButNotBeInBreak(
            this Recommendation recommendation,
            BreakExternalReference value
            )
        {
            _ = recommendation.ExternalBreakNo.Should()
                .NotBe(value.ToString(), becauseArgs: null);

            return(recommendation);
        }
コード例 #6
0
        public void StringToBreakExternalReferenceEquality(string value)
        {
            // Arrange
            BreakExternalReference subject = value;

            // Act
            bool result = value.Equals(subject);

            // Assert
            _ = result.Should().BeTrue(becauseArgs: null);
        }
コード例 #7
0
        public void StringToBreakExternalReferenceInequalityOperator(string value)
        {
            // Arrange
            BreakExternalReference subject = value;

            // Act
            bool result = subject != "Badger";

            // Assert
            _ = result.Should().BeTrue(becauseArgs: null);
        }
コード例 #8
0
        public void AssigningToAString(string value)
        {
            // Arrange
            BreakExternalReference subject = value;

            // Act
            string result = subject;

            // Assert
            _ = value.Should().BeEquivalentTo(result, becauseArgs: null);
        }
コード例 #9
0
        public void Appending(string value)
        {
            // Arrange
            BreakExternalReference subject         = value;
            BreakExternalReference subjectAppended = subject + value;

            // Act
            bool result = subjectAppended == subject + value;

            // Assert
            _ = result.Should().BeTrue(becauseArgs: null);
        }
コード例 #10
0
 public RemovedSponsoredSpotCountFromBreakEventArgs(
     BreakExternalReference breakExternalReference,
     ProductExternalReference productExternalReference,
     SponsorshipApplicability applicability,
     SponsorshipCalculationType calculationType)
     : base(
         breakExternalReference,
         advertiserIdentifier: string.Empty,
         clashExternalReference: string.Empty,
         productExternalReference,
         true,
         applicability,
         calculationType,
         (SponsorshipRestrictionType.SpotCount, Duration.Zero)
コード例 #11
0
 public SmoothSponsorshipTimeline FindTimelineForCompetitor(
     BreakExternalReference breakExternalReference,
     string advertiserIdentifier,
     string clashExternalReference) =>
 _timelines.FirstOrDefault(t =>
                           t.BreakExternalReferences.Contains((string)breakExternalReference) &&
                           (
                               t.AdvertiserIdentifiers
                               .Select(a => a.advertiserIdentifier)
                               .Contains(advertiserIdentifier) ||
                               t.ClashExternalReferences
                               .Select(c => c.clashExternalReference)
                               .Contains(clashExternalReference)
                           )
                           );
コード例 #12
0
        public void BreakExternalReferenceToStringAsObjectEquality(
            string left,
            string right
            )
        {
            // Arrange
            BreakExternalReference subjectLeft = left;
            object subjectRight = right;

            // Act
            bool result = subjectLeft.Equals(subjectRight);

            // Assert
            _ = result.Should().BeTrue(becauseArgs: null);
        }
コード例 #13
0
 public AddedSponsoredSpotCountToBreakEventArgs(
     BreakExternalReference breakExternalReference,
     ProductExternalReference productExternalReference,
     SponsorshipApplicability applicability,
     SponsorshipCalculationType calculationType)
     : base(
         breakExternalReference,
         productExternalReference,
         isSponsor: true,
         productAdvertiserIdentifier: string.Empty,
         productClashCode: string.Empty,
         competitorType: SponsorshipCompetitorType.Neither,
         applicability,
         calculationType,
         (SponsorshipRestrictionType.SpotCount, Duration.Zero)
コード例 #14
0
 public RemovedCompetitorSpotCountFromBreakEventArgs(
     BreakExternalReference breakExternalReference,
     string advertiserIdentifier,
     string clashExternalReference,
     ProductExternalReference productExternalReference,
     SponsorshipApplicability applicability,
     SponsorshipCalculationType calculationType)
     : base(
         breakExternalReference,
         advertiserIdentifier,
         clashExternalReference,
         productExternalReference,
         false,
         applicability,
         calculationType,
         (SponsorshipRestrictionType.SpotCount, Duration.Zero)
コード例 #15
0
 public AddedCompetitorSpotCountToBreakEventArgs(
     BreakExternalReference breakExternalReference,
     ProductExternalReference productExternalReference,
     string productAdvertiserIdentifier,
     string productClashCode,
     SponsorshipCompetitorType competitorType,
     SponsorshipApplicability sponsorshipApplicability,
     SponsorshipCalculationType calculationType)
     : base(
         breakExternalReference,
         productExternalReference,
         isSponsor: false,
         productAdvertiserIdentifier,
         productClashCode,
         competitorType,
         sponsorshipApplicability,
         calculationType,
         (SponsorshipRestrictionType.SpotCount, Duration.Zero))
コード例 #16
0
 public static bool IsContainerReference(BreakExternalReference breakExternalReference) =>
 ContainerReference.TryParse(breakExternalReference, out var _);
コード例 #17
0
 public SmoothSponsorshipTimeline FindTimelineForSponsoredProduct(
     BreakExternalReference breakExternalReference,
     string sponsoredProduct) =>
 _timelines.FirstOrDefault(t =>
                           t.BreakExternalReferences.Contains((string)breakExternalReference) &&
                           t.SponsoredProducts.Contains(sponsoredProduct));