public IReadOnlyCollection <NamedValue <string> > Execute(
                BuildTagsOp <ExecuteOpRequestedEvent <long, SendNotificationOp> > operation)
            {
                new { operation }.AsArg().Must().NotBeNull();
                new { operation.InheritableTags }.AsArg().Must().BeNull();
                new { operation.Event }.AsArg().Must().NotBeNull();
                new { operation.Event.Operation }.AsArg().Must().NotBeNull();
                new { operation.Event.Operation.Notification }.AsArg().Must().NotBeNull().And().BeOfType <IntegrationTestNotification>();

                var result = new List <NamedValue <string> >
                {
                    new NamedValue <string>("notification-type", operation.Event.Operation.Notification.GetType().ToStringReadable()),
                    new NamedValue <string>("random-data", "random-" + Guid.NewGuid()),
                };

                if (operation.Event.Operation.Notification is IntegrationTestNotification notification)
                {
                    result.Add(new NamedValue <string>("scenario", notification.ScenarioBeingTested));
                }

                return(result);
            }
Exemple #2
0
        static BuildTagsOpTEventTest()
        {
            ConstructorArgumentValidationTestScenarios
            .RemoveAllScenarios()
            .AddScenario(() =>
                         new ConstructorArgumentValidationTestScenario <BuildTagsOp <AudienceOptedOutOfAllChannelsEvent> >
            {
                Name             = "constructor should throw ArgumentNullException when parameter 'event' is null scenario",
                ConstructionFunc = () =>
                {
                    var referenceObject = A.Dummy <BuildTagsOp <AudienceOptedOutOfAllChannelsEvent> >();

                    var result = new BuildTagsOp <AudienceOptedOutOfAllChannelsEvent>(
                        referenceObject.TrackingCodeId,
                        null,
                        referenceObject.InheritableTags);

                    return(result);
                },
                ExpectedExceptionType            = typeof(ArgumentNullException),
                ExpectedExceptionMessageContains = new[] { "event", },
            });
        }