private static bool ValidatePublishedEvents(
            ICollection <EventGridEvent> events,
            EventGridEventPublisherSettings settings)
        {
            if (events.Count != 11)
            {
                return(false);
            }

            foreach (var @event in events)
            {
                if (@event.Data is JObject json &&
                    @event.Id.Equals(json["sg_event_id"].Value <string>(), StringComparison.OrdinalIgnoreCase) &&
                    @event.Subject.Equals(settings.BuildEventSubject(json), StringComparison.OrdinalIgnoreCase) &&
                    @event.EventType.Equals(settings.BuildEventType(json), StringComparison.OrdinalIgnoreCase) &&
                    json["custom_arg1"].Value <string>().Equals("test!"))
                {
                    continue;
                }

                return(false);
            }

            return(true);
        }
        public void BuildEventType_ThrowsInvalidOperationException_Test()
        {
            //Arrange
            var json = new JObject();

            //Act
            Action act = () => _sut.BuildEventType(json);

            //Assert
            act.Should()
            .ThrowExactly <InvalidOperationException>()
            .WithMessage("'event' property cannot be extracted from the SendGrid event json.");
        }