protected RemovedSpotFromBreakEventArgs( BreakExternalReference breakExternalReference, string advertiserIdentifier, string clashExternalReference, ProductExternalReference productExternalReference, bool isSponsor, SponsorshipApplicability applicability, SponsorshipCalculationType calculationType, (SponsorshipRestrictionType type, Duration duration) restrictionType
public void AssignmentIsNewInstance(string value) { // Arrange // Act BreakExternalReference subject = value; // Assert _ = subject.Should().NotBeSameAs(value, becauseArgs: null); }
public void AssigningAValue(string value) { // Arrange // Act BreakExternalReference result = value; // Assert _ = value.Should().BeEquivalentTo(result, becauseArgs: null); }
/// <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)
public static Recommendation ButNotBeInBreak( this Recommendation recommendation, BreakExternalReference value ) { _ = recommendation.ExternalBreakNo.Should() .NotBe(value.ToString(), becauseArgs: null); return(recommendation); }
public void StringToBreakExternalReferenceEquality(string value) { // Arrange BreakExternalReference subject = value; // Act bool result = value.Equals(subject); // Assert _ = result.Should().BeTrue(becauseArgs: null); }
public void StringToBreakExternalReferenceInequalityOperator(string value) { // Arrange BreakExternalReference subject = value; // Act bool result = subject != "Badger"; // Assert _ = result.Should().BeTrue(becauseArgs: null); }
public void AssigningToAString(string value) { // Arrange BreakExternalReference subject = value; // Act string result = subject; // Assert _ = value.Should().BeEquivalentTo(result, becauseArgs: null); }
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); }
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)
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) ) );
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); }
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)
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)
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))
public static bool IsContainerReference(BreakExternalReference breakExternalReference) => ContainerReference.TryParse(breakExternalReference, out var _);
public SmoothSponsorshipTimeline FindTimelineForSponsoredProduct( BreakExternalReference breakExternalReference, string sponsoredProduct) => _timelines.FirstOrDefault(t => t.BreakExternalReferences.Contains((string)breakExternalReference) && t.SponsoredProducts.Contains(sponsoredProduct));