예제 #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="CouldNotGetOrUseDeliveryChannelConfigsEvent"/> class.
        /// </summary>
        /// <param name="id">The notification tracking code identifier.</param>
        /// <param name="timestampUtc">The timestamp in UTC.</param>
        /// <param name="getAudienceResult">The result of executing a <see cref="GetAudienceOp"/>.</param>
        /// <param name="getDeliveryChannelConfigsResult">The result of executing a <see cref="GetDeliveryChannelConfigsOp"/>.</param>
        public CouldNotGetOrUseDeliveryChannelConfigsEvent(
            long id,
            DateTime timestampUtc,
            GetAudienceResult getAudienceResult,
            GetDeliveryChannelConfigsResult getDeliveryChannelConfigsResult)
            : base(id, timestampUtc)
        {
            new { getAudienceResult }.AsArg().Must().NotBeNull();
            var getAudienceOutcome = getAudienceResult.GetOutcome();

            new { getAudienceOutcome }.AsArg().Must().BeElementIn(new[] { GetAudienceOutcome.GotAudienceWithNoFailuresReported, GetAudienceOutcome.GotAudienceWithReportedFailuresIgnored });

            new { getDeliveryChannelConfigsResult }.AsArg().Must().NotBeNull();
            var getDeliveryChannelConfigsOutcome = getDeliveryChannelConfigsResult.GetOutcome();

            new { getDeliveryChannelConfigsOutcome }.AsArg().Must().BeElementIn(new[] { GetDeliveryChannelConfigsOutcome.CouldNotGetDeliveryChannelConfigsAndNoFailuresReported, GetDeliveryChannelConfigsOutcome.CouldNotGetDeliveryChannelConfigsWithSomeFailuresReported, GetDeliveryChannelConfigsOutcome.DespiteGettingDeliveryChannelConfigsFailuresPreventUsingThem });

            this.GetAudienceResult = getAudienceResult;
            this.GetDeliveryChannelConfigsResult = getDeliveryChannelConfigsResult;
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="PrepareToSendNotificationEventBase"/> class.
        /// </summary>
        /// <param name="id">The notification tracking code identifier.</param>
        /// <param name="timestampUtc">The timestamp in UTC.</param>
        /// <param name="getAudienceResult">The result of executing a <see cref="GetAudienceOp"/>.</param>
        /// <param name="getDeliveryChannelConfigsResult">The result of executing a <see cref="GetDeliveryChannelConfigsOp"/>.</param>
        /// <param name="prepareToSendNotificationResult">The result of preparing to send the notification on all configured channels.</param>
        protected PrepareToSendNotificationEventBase(
            long id,
            DateTime timestampUtc,
            GetAudienceResult getAudienceResult,
            GetDeliveryChannelConfigsResult getDeliveryChannelConfigsResult,
            PrepareToSendNotificationResult prepareToSendNotificationResult)
            : base(id, timestampUtc)
        {
            new { getAudienceResult }.AsArg().Must().NotBeNull();
            var getAudienceOutcome = getAudienceResult.GetOutcome();

            new { getAudienceOutcome }.AsArg().Must().BeElementIn(new[] { GetAudienceOutcome.GotAudienceWithNoFailuresReported, GetAudienceOutcome.GotAudienceWithReportedFailuresIgnored });

            new { getDeliveryChannelConfigsResult }.AsArg().Must().NotBeNull();
            var getDeliveryChannelConfigsOutcome = getDeliveryChannelConfigsResult.GetOutcome();

            new { getDeliveryChannelConfigsOutcome }.AsArg().Must().BeElementIn(new[] { GetDeliveryChannelConfigsOutcome.GotDeliveryChannelConfigsWithNoFailuresReported, GetDeliveryChannelConfigsOutcome.GotDeliveryChannelConfigsWithReportedFailuresIgnored });

            new { prepareToSendNotificationResult }.AsArg().Must().NotBeNull();

            this.GetAudienceResult = getAudienceResult;
            this.GetDeliveryChannelConfigsResult = getDeliveryChannelConfigsResult;
            this.PrepareToSendNotificationResult = prepareToSendNotificationResult;
        }