public void Parse_Delivered_Event()
        {
            var json = new JsonEventBuilder().AppendDelivered().Build();
            var result = parser.ParseEvents(json);

            AssertCommonProperties(result, typeof(DeliveryEvent));;
        }
        public void Parse_Drop_Event()
        {
            var json = new JsonEventBuilder().AppendDrop().Build();
            var result = parser.ParseEvents(json);

            AssertCommonProperties(result, typeof(DroppedEvent));
            var dropEvent = result[0] as DroppedEvent;
            Assert.AreEqual("Bounced Address", dropEvent.Reason);
        }
        public void Parse_Click_Event()
        {
            var json = new JsonEventBuilder().AppendClick().Build();
            var result = parser.ParseEvents(json);

            AssertCommonProperties(result, typeof(ClickEvent));
            var bounceEvent = result[0] as ClickEvent;
            Assert.AreEqual("http://yourdomain.com/blog/news.html", bounceEvent.Url);
        }
        public void Parse_BounceWithNullArgs_EventIsStillParsed()
        {
            var json = new JsonEventBuilder().AppendBounceNull().Build();
            var result = parser.ParseEvents(json);

            var bounceEvent = result[0] as BounceEvent;
            Assert.AreEqual("550 5.7.999 The user is inactive and not accepting messages.", bounceEvent.Reason);
            Assert.AreEqual("blocked", bounceEvent.BounceType);
        }
        public void Parse_Group_Resubscribe_Event()
        {
            var json = new JsonEventBuilder().AppendGroupResubscribe().Build();
            var result = parser.ParseEvents(json);

            AssertCommonProperties(result, typeof(GroupResubscribeEvent));
            var castEvent = result[0] as GroupResubscribeEvent;
            Assert.AreEqual(1, castEvent.GroupId);
        }
        public void Parse_Deferred_Event()
        {
            var json = new JsonEventBuilder().AppendDeferred().Build();
            var result = parser.ParseEvents(json);

            AssertCommonProperties(result, typeof(DeferredEvent));
            var deferredEvent = result[0] as DeferredEvent;
            Assert.AreEqual("400 Try again", deferredEvent.Response);
            Assert.AreEqual("10", deferredEvent.Attempts);
        }
        public void Parse_Bounce_Event()
        {
            var json = new JsonEventBuilder().AppendBounce().Build();
            var result = parser.ParseEvents(json);

            AssertCommonProperties(result, typeof(BounceEvent));
            var bounceEvent = result[0] as BounceEvent;
            Assert.AreEqual("500 No Such User", bounceEvent.Reason);
            Assert.AreEqual("bounce", bounceEvent.BounceType);
        }
        public void Parse_Unsubscribe_Event()
        {
            var json = new JsonEventBuilder().AppendUnsubscribe().Build();
            var result = parser.ParseEvents(json);

            AssertCommonProperties(result, typeof(UnsubscribeEvent));
        }
        public void Parse_SpamReport_Event()
        {
            var json = new JsonEventBuilder().AppendSpamReport().Build();
            var result = parser.ParseEvents(json);

            AssertCommonProperties(result, typeof(SpamReportEvent));
        }
        public void Parse_Processed_Event()
        {
            var json = new JsonEventBuilder().AppendProcessed().Build();
            var result = parser.ParseEvents(json);

            AssertCommonProperties(result, typeof(ProcessedEvent));
        }
        public void Parse_Open_Event()
        {
            var json = new JsonEventBuilder().AppendOpen().Build();
            var result = parser.ParseEvents(json);

            AssertCommonProperties(result, typeof(OpenEvent)); ;
        }