public void CheckResultThrowsExceptionWithSubscriberErrorIfPresent()
        {
            var result = new TriggeredSendCreateResult
            {
                StatusCode = "Error",
                StatusMessage = "Reason for failing",
                SubscriberFailures = new []{ new SubscriberResult{ErrorCode = "24", ErrorDescription = "Subscriber was excluded by List Detective"}}
            };

            var ex = Assert.Throws<Exception>(() => ExactTargetResultChecker.CheckResult(result));

            Assert.That(ex.Message, Is.StringContaining("Error"));
            Assert.That(ex.Message, Is.StringContaining("Reason for failing"));
            Assert.That(ex.Message, Is.StringContaining("24"));
            Assert.That(ex.Message, Is.StringContaining("Subscriber was excluded by List Detective"));

        }
Exemple #2
0
        public void CheckResultThrowsExceptionWithSubscriberErrorIfPresent()
        {
            var result = new TriggeredSendCreateResult
            {
                StatusCode         = "Error",
                StatusMessage      = "Reason for failing",
                SubscriberFailures = new [] { new SubscriberResult {
                                                  ErrorCode = "24", ErrorDescription = "Subscriber was excluded by List Detective"
                                              } }
            };

            var ex = Assert.Throws <Exception>(() => ExactTargetResultChecker.CheckResult(result));

            Assert.That(ex.Message, Is.StringContaining("Error"));
            Assert.That(ex.Message, Is.StringContaining("Reason for failing"));
            Assert.That(ex.Message, Is.StringContaining("24"));
            Assert.That(ex.Message, Is.StringContaining("Subscriber was excluded by List Detective"));
        }
Exemple #3
0
        public void CheckResultThrowsExceptionWithSubscriberExcludedErrorAndSubscriberInfoIsNotSupplied()
        {
            var result = new TriggeredSendCreateResult
            {
                StatusCode         = "Error",
                StatusMessage      = "Reason for failing",
                SubscriberFailures = new[]
                {
                    new SubscriberResult {
                        ErrorCode = "24", ErrorDescription = "Subscriber was excluded by List Detective"
                    }
                }
            };

            var ex = Assert.Throws <SubscriberExcludedException>(() => ExactTargetResultChecker.CheckResult(result));

            Assert.IsNull(ex.EmailAddress);
            Assert.AreEqual("Subcriber was excluded. EmailAddress:  Additional Info: ExactTarget response indicates failure. StatusCode:Error StatusMessage:Reason for failing SubscriberFailures: ErrorCode:24 ErrorDescription:Subscriber was excluded by List Detective", ex.Message);
        }
        public void CheckResultThrowsExceptionWithGenericSubscriberError()
        {
            var result = new TriggeredSendCreateResult
            {
                StatusCode = "Error",
                StatusMessage = "Reason for failing",
                SubscriberFailures = new[]
                {
                    new SubscriberResult { ErrorCode = "00", ErrorDescription = "Generic subscriber failure" }
                }
            };

            var ex = Assert.Throws<ExactTargetException>(() => ExactTargetResultChecker.CheckResult(result));

            Assert.That(ex.Message, Is.StringContaining("Error"));
            Assert.That(ex.Message, Is.StringContaining("Reason for failing"));
            Assert.That(ex.Message, Is.StringContaining("00"));
            Assert.That(ex.Message, Is.StringContaining("Generic subscriber failure"));
        }
Exemple #5
0
        public void CheckResultThrowsExceptionWithGenericSubscriberError()
        {
            var result = new TriggeredSendCreateResult
            {
                StatusCode         = "Error",
                StatusMessage      = "Reason for failing",
                SubscriberFailures = new[]
                {
                    new SubscriberResult {
                        ErrorCode = "00", ErrorDescription = "Generic subscriber failure"
                    }
                }
            };

            var ex = Assert.Throws <ExactTargetException>(() => ExactTargetResultChecker.CheckResult(result));

            Assert.That(ex.Message, Is.StringContaining("Error"));
            Assert.That(ex.Message, Is.StringContaining("Reason for failing"));
            Assert.That(ex.Message, Is.StringContaining("00"));
            Assert.That(ex.Message, Is.StringContaining("Generic subscriber failure"));
        }
        public void CheckResultThrowsExceptionWithSubscriberExcludedError()
        {
            var result = new TriggeredSendCreateResult
            {
                StatusCode = "Error",
                StatusMessage = "Reason for failing",
                SubscriberFailures = new []
                {
                    new SubscriberResult
                    {
                        ErrorCode = "24", ErrorDescription = "Subscriber was excluded by List Detective",
                        Subscriber = new Subscriber {EmailAddress = "*****@*****.**"}
                    }
                }
            };

            var ex = Assert.Throws<SubscriberExcludedException>(() => ExactTargetResultChecker.CheckResult(result));

            Assert.AreEqual("*****@*****.**", ex.EmailAddress);
            Assert.AreEqual("Subcriber was excluded. EmailAddress: [email protected] Additional Info: ExactTarget response indicates failure. StatusCode:Error StatusMessage:Reason for failing SubscriberFailures: ErrorCode:24 ErrorDescription:Subscriber was excluded by List Detective", ex.Message);
        }