示例#1
0
 public void ThrowExceptionIfErrorStatusCodeIsUpgradeRequired()
 {
     try {
         BraintreeService.ThrowExceptionIfErrorStatusCode((HttpStatusCode)426, null);
         Assert.Fail("Expected an AuthenticationException but none was thrown.");
     } catch (Braintree.Exceptions.UpgradeRequiredException) {
         // expected
     }
 }
示例#2
0
 public void ThrowExceptionIfErrorStatusCodeIsDownForMaintenance()
 {
     BraintreeService.ThrowExceptionIfErrorStatusCode((HttpStatusCode)503, null);
 }
示例#3
0
 public void ThrowExceptionIfErrorStatusCodeIsTooManyRequests()
 {
     BraintreeService.ThrowExceptionIfErrorStatusCode((HttpStatusCode)429, null);
 }
示例#4
0
 public void ThrowExceptionIfErrorStatusCodeIsUpgradeRequired()
 {
     BraintreeService.ThrowExceptionIfErrorStatusCode((HttpStatusCode)426, null);
 }
 public void ThrowExceptionIfErrorStatusCodeIsDownForMaintenance()
 {
     Assert.Throws <DownForMaintenanceException> (() => BraintreeService.ThrowExceptionIfErrorStatusCode((HttpStatusCode)503, null));
 }
 public void ThrowExceptionIfErrorStatusCodeIsTooManyRequests()
 {
     Assert.Throws <TooManyRequestsException>(() => BraintreeService.ThrowExceptionIfErrorStatusCode((HttpStatusCode)429, null));
 }
 public void ThrowExceptionIfErrorStatusCodeIsUpgradeRequired()
 {
     Assert.Throws <UpgradeRequiredException>(() => BraintreeService.ThrowExceptionIfErrorStatusCode((HttpStatusCode)426, null));
 }
示例#8
0
 public void ThrowExceptionIfErrorStatusCodeIsServiceUnavailable()
 {
     Assert.Throws <ServiceUnavailableException> (() => BraintreeService.ThrowExceptionIfErrorStatusCode((HttpStatusCode)503, null));
 }
示例#9
0
 public void ThrowExceptionIfErrorStatusCodeIsGatewayTimeout()
 {
     Assert.Throws <GatewayTimeoutException> (() => BraintreeService.ThrowExceptionIfErrorStatusCode((HttpStatusCode)504, null));
 }
示例#10
0
 public void ThrowExceptionIfErrorStatusCodeIsInternalServerError()
 {
     Assert.Throws <ServerException>(() => BraintreeService.ThrowExceptionIfErrorStatusCode((HttpStatusCode)500, null));
 }
示例#11
0
 public void ThrowExceptionIfErrorStatusCodeIsRequestTimeout()
 {
     Assert.Throws <RequestTimeoutException>(() => BraintreeService.ThrowExceptionIfErrorStatusCode((HttpStatusCode)408, null));
 }
示例#12
0
 public void ThrowExceptionIfErrorStatusCodeIsNotFound()
 {
     Assert.Throws <NotFoundException>(() => BraintreeService.ThrowExceptionIfErrorStatusCode((HttpStatusCode)404, null));
 }
示例#13
0
 public void ThrowExceptionIfErrorStatusCodeIsForbidden()
 {
     Assert.Throws <AuthorizationException>(() => BraintreeService.ThrowExceptionIfErrorStatusCode((HttpStatusCode)403, null));
 }
示例#14
0
 public void ThrowExceptionIfErrorStatusCodeIsUnauthorized()
 {
     Assert.Throws <AuthenticationException>(() => BraintreeService.ThrowExceptionIfErrorStatusCode((HttpStatusCode)401, null));
 }