示例#1
0
        public void NotificationThrowOnNotFound()
        {
            var validJson = @"{""id"": ""id""}";

            Configuration.SecretKey = "sk_test_a8c31522f14b48b907fa14f2fa45e3bd";

            using (ShimsContext.Create())
            {
                Exception e = new Payplug.Exceptions.Fakes.ShimClientWebException()
                {
                    StatusCodeGet = () => HttpStatusCode.NotFound
                };
                Payplug.Core.Fakes.ShimService.GetUri = (Uri a) => { throw e; };
                Assert.Throws <InvalidApiResourceException>(delegate { Notification.Treat(validJson); }, "The resource you requested could not be found.");
                Assert.Throws <InvalidApiResourceException>(delegate { Notification.TreatRaw(validJson); }, "The resource you requested could not be found.");
            }
        }
示例#2
0
        public void NotificationThrowOnNotFound()
        {
            var validJson = @"{""id"": ""id""}";
            Configuration.SecretKey = "sk_test_a8c31522f14b48b907fa14f2fa45e3bd";

            using (ShimsContext.Create())
            {
                Exception e = new Payplug.Exceptions.Fakes.ShimClientWebException()
                {
                    StatusCodeGet = () => HttpStatusCode.NotFound
                };
                Payplug.Core.Fakes.ShimService.GetUri = (Uri a) => { throw e; };
                Assert.Throws<InvalidApiResourceException>(delegate { Notification.Treat(validJson); }, "The resource you requested could not be found.");
                Assert.Throws<InvalidApiResourceException>(delegate { Notification.TreatRaw(validJson); }, "The resource you requested could not be found.");
            }
        }