Skip to content

Commit

Permalink
Updated to v3.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
rhodgkins committed Apr 12, 2019
1 parent e0316a9 commit fc31778
Show file tree
Hide file tree
Showing 4 changed files with 159 additions and 2 deletions.
2 changes: 1 addition & 1 deletion HTTPStatusCodes.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'HTTPStatusCodes'
s.version = '3.2.0'
s.version = '3.3.0'
s.license = 'MIT'
s.summary = 'Swift enum wrapper for easier handling of HTTP status codes'
s.homepage = 'https://github.com/rhodgkins/SwiftHTTPStatusCodes'
Expand Down
2 changes: 1 addition & 1 deletion Tests/HTTPStatusCodes.xcconfig
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

PRODUCT_NAME = HTTPStatusCodes
PRODUCT_BUNDLE_IDENTIFIER = uk.co.rhodgkins.swift.$(PRODUCT_NAME:rfc1034identifier)
HSC_VERSION = 3.2.0
HSC_VERSION = 3.3.0

// Universal Framework
APPLICATION_EXTENSION_API_ONLY = YES
Expand Down
78 changes: 78 additions & 0 deletions Tests/HTTPStatusCodesTests/ObjectiveCRegressionTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -255,5 +255,83 @@ -(void)testVersion3_2
XCTAssertEqual(HTTPStatusCodeNetworkConnectTimeoutError, 599);
}

-(void)testVersion3_3
{
XCTAssertEqual(HTTPStatusCodeContinue, 100);
XCTAssertEqual(HTTPStatusCodeSwitchingProtocols, 101);
XCTAssertEqual(HTTPStatusCodeProcessing, 102);
XCTAssertEqual(HTTPStatusCodeEarlyHints, 103);
XCTAssertEqual(HTTPStatusCodeOK, 200);
XCTAssertEqual(HTTPStatusCodeCreated, 201);
XCTAssertEqual(HTTPStatusCodeAccepted, 202);
XCTAssertEqual(HTTPStatusCodeNonAuthoritativeInformation, 203);
XCTAssertEqual(HTTPStatusCodeNoContent, 204);
XCTAssertEqual(HTTPStatusCodeResetContent, 205);
XCTAssertEqual(HTTPStatusCodePartialContent, 206);
XCTAssertEqual(HTTPStatusCodeMultiStatus, 207);
XCTAssertEqual(HTTPStatusCodeAlreadyReported, 208);
XCTAssertEqual(HTTPStatusCodeIMUsed, 226);
XCTAssertEqual(HTTPStatusCodeMultipleChoices, 300);
XCTAssertEqual(HTTPStatusCodeMovedPermanently, 301);
XCTAssertEqual(HTTPStatusCodeFound, 302);
XCTAssertEqual(HTTPStatusCodeSeeOther, 303);
XCTAssertEqual(HTTPStatusCodeNotModified, 304);
XCTAssertEqual(HTTPStatusCodeUseProxy, 305);
XCTAssertEqual(HTTPStatusCodeTemporaryRedirect, 307);
XCTAssertEqual(HTTPStatusCodePermanentRedirect, 308);
XCTAssertEqual(HTTPStatusCodeBadRequest, 400);
XCTAssertEqual(HTTPStatusCodeUnauthorized, 401);
XCTAssertEqual(HTTPStatusCodePaymentRequired, 402);
XCTAssertEqual(HTTPStatusCodeForbidden, 403);
XCTAssertEqual(HTTPStatusCodeNotFound, 404);
XCTAssertEqual(HTTPStatusCodeMethodNotAllowed, 405);
XCTAssertEqual(HTTPStatusCodeNotAcceptable, 406);
XCTAssertEqual(HTTPStatusCodeProxyAuthenticationRequired, 407);
XCTAssertEqual(HTTPStatusCodeRequestTimeout, 408);
XCTAssertEqual(HTTPStatusCodeConflict, 409);
XCTAssertEqual(HTTPStatusCodeGone, 410);
XCTAssertEqual(HTTPStatusCodeLengthRequired, 411);
XCTAssertEqual(HTTPStatusCodePreconditionFailed, 412);
XCTAssertEqual(HTTPStatusCodePayloadTooLarge, 413);
XCTAssertEqual(HTTPStatusCodeURITooLong, 414);
XCTAssertEqual(HTTPStatusCodeUnsupportedMediaType, 415);
XCTAssertEqual(HTTPStatusCodeRangeNotSatisfiable, 416);
XCTAssertEqual(HTTPStatusCodeExpectationFailed, 417);
XCTAssertEqual(HTTPStatusCodeImATeapot, 418);
XCTAssertEqual(HTTPStatusCodeMisdirectedRequest, 421);
XCTAssertEqual(HTTPStatusCodeUnprocessableEntity, 422);
XCTAssertEqual(HTTPStatusCodeLocked, 423);
XCTAssertEqual(HTTPStatusCodeFailedDependency, 424);
XCTAssertEqual(HTTPStatusCodeTooEarly, 425);
XCTAssertEqual(HTTPStatusCodeUpgradeRequired, 426);
XCTAssertEqual(HTTPStatusCodePreconditionRequired, 428);
XCTAssertEqual(HTTPStatusCodeTooManyRequests, 429);
XCTAssertEqual(HTTPStatusCodeRequestHeaderFieldsTooLarge, 431);
XCTAssertEqual(HTTPStatusCodeIISLoginTimeout, 440);
XCTAssertEqual(HTTPStatusCodeNginxNoResponse, 444);
XCTAssertEqual(HTTPStatusCodeIISRetryWith, 449);
XCTAssertEqual(HTTPStatusCodeBlockedByWindowsParentalControls, 450);
XCTAssertEqual(HTTPStatusCodeUnavailableForLegalReasons, 451);
XCTAssertEqual(HTTPStatusCodeNginxSSLCertificateError, 495);
XCTAssertEqual(HTTPStatusCodeNginxSSLCertificateRequired, 496);
XCTAssertEqual(HTTPStatusCodeNginxHTTPToHTTPS, 497);
XCTAssertEqual(HTTPStatusCodeTokenExpired, 498);
XCTAssertEqual(HTTPStatusCodeNginxClientClosedRequest, 499);
XCTAssertEqual(HTTPStatusCodeInternalServerError, 500);
XCTAssertEqual(HTTPStatusCodeNotImplemented, 501);
XCTAssertEqual(HTTPStatusCodeBadGateway, 502);
XCTAssertEqual(HTTPStatusCodeServiceUnavailable, 503);
XCTAssertEqual(HTTPStatusCodeGatewayTimeout, 504);
XCTAssertEqual(HTTPStatusCodeHTTPVersionNotSupported, 505);
XCTAssertEqual(HTTPStatusCodeVariantAlsoNegotiates, 506);
XCTAssertEqual(HTTPStatusCodeInsufficientStorage, 507);
XCTAssertEqual(HTTPStatusCodeLoopDetected, 508);
XCTAssertEqual(HTTPStatusCodeBandwidthLimitExceeded, 509);
XCTAssertEqual(HTTPStatusCodeNotExtended, 510);
XCTAssertEqual(HTTPStatusCodeNetworkAuthenticationRequired, 511);
XCTAssertEqual(HTTPStatusCodeSiteIsFrozen, 530);
XCTAssertEqual(HTTPStatusCodeNetworkConnectTimeoutError, 599);
}

@end
#endif
79 changes: 79 additions & 0 deletions Tests/HTTPStatusCodesTests/RegressionTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,85 @@ final class RegressionTests: XCTestCase {

XCTAssertEqual(HTTPURLResponse(url: URL(string: "http://www.google.com")!, statusCode: .ok, httpVersion: nil, headerFields: nil)!.statusCodeValue, .ok)
}

func testVersion3_3() {
XCTAssertEqual(HTTPStatusCode.continue, 100)
XCTAssertEqual(HTTPStatusCode.switchingProtocols, 101)
XCTAssertEqual(HTTPStatusCode.processing, 102)
XCTAssertEqual(HTTPStatusCode.earlyHints, 103)
XCTAssertEqual(HTTPStatusCode.ok, 200)
XCTAssertEqual(HTTPStatusCode.created, 201)
XCTAssertEqual(HTTPStatusCode.accepted, 202)
XCTAssertEqual(HTTPStatusCode.nonAuthoritativeInformation, 203)
XCTAssertEqual(HTTPStatusCode.noContent, 204)
XCTAssertEqual(HTTPStatusCode.resetContent, 205)
XCTAssertEqual(HTTPStatusCode.partialContent, 206)
XCTAssertEqual(HTTPStatusCode.multiStatus, 207)
XCTAssertEqual(HTTPStatusCode.alreadyReported, 208)
XCTAssertEqual(HTTPStatusCode.imUsed, 226)
XCTAssertEqual(HTTPStatusCode.multipleChoices, 300)
XCTAssertEqual(HTTPStatusCode.movedPermanently, 301)
XCTAssertEqual(HTTPStatusCode.found, 302)
XCTAssertEqual(HTTPStatusCode.seeOther, 303)
XCTAssertEqual(HTTPStatusCode.notModified, 304)
XCTAssertEqual(HTTPStatusCode.useProxy, 305)
XCTAssertEqual(HTTPStatusCode.temporaryRedirect, 307)
XCTAssertEqual(HTTPStatusCode.permanentRedirect, 308)
XCTAssertEqual(HTTPStatusCode.badRequest, 400)
XCTAssertEqual(HTTPStatusCode.unauthorized, 401)
XCTAssertEqual(HTTPStatusCode.paymentRequired, 402)
XCTAssertEqual(HTTPStatusCode.forbidden, 403)
XCTAssertEqual(HTTPStatusCode.notFound, 404)
XCTAssertEqual(HTTPStatusCode.methodNotAllowed, 405)
XCTAssertEqual(HTTPStatusCode.notAcceptable, 406)
XCTAssertEqual(HTTPStatusCode.proxyAuthenticationRequired, 407)
XCTAssertEqual(HTTPStatusCode.requestTimeout, 408)
XCTAssertEqual(HTTPStatusCode.conflict, 409)
XCTAssertEqual(HTTPStatusCode.gone, 410)
XCTAssertEqual(HTTPStatusCode.lengthRequired, 411)
XCTAssertEqual(HTTPStatusCode.preconditionFailed, 412)
XCTAssertEqual(HTTPStatusCode.payloadTooLarge, 413)
XCTAssertEqual(HTTPStatusCode.uriTooLong, 414)
XCTAssertEqual(HTTPStatusCode.unsupportedMediaType, 415)
XCTAssertEqual(HTTPStatusCode.rangeNotSatisfiable, 416)
XCTAssertEqual(HTTPStatusCode.expectationFailed, 417)
XCTAssertEqual(HTTPStatusCode.imATeapot, 418)
XCTAssertEqual(HTTPStatusCode.misdirectedRequest, 421)
XCTAssertEqual(HTTPStatusCode.unprocessableEntity, 422)
XCTAssertEqual(HTTPStatusCode.locked, 423)
XCTAssertEqual(HTTPStatusCode.failedDependency, 424)
XCTAssertEqual(HTTPStatusCode.tooEarly, 425)
XCTAssertEqual(HTTPStatusCode.upgradeRequired, 426)
XCTAssertEqual(HTTPStatusCode.preconditionRequired, 428)
XCTAssertEqual(HTTPStatusCode.tooManyRequests, 429)
XCTAssertEqual(HTTPStatusCode.requestHeaderFieldsTooLarge, 431)
XCTAssertEqual(HTTPStatusCode.iisLoginTimeout, 440)
XCTAssertEqual(HTTPStatusCode.nginxNoResponse, 444)
XCTAssertEqual(HTTPStatusCode.iisRetryWith, 449)
XCTAssertEqual(HTTPStatusCode.blockedByWindowsParentalControls, 450)
XCTAssertEqual(HTTPStatusCode.unavailableForLegalReasons, 451)
XCTAssertEqual(HTTPStatusCode.nginxSSLCertificateError, 495)
XCTAssertEqual(HTTPStatusCode.nginxSSLCertificateRequired, 496)
XCTAssertEqual(HTTPStatusCode.nginxHTTPToHTTPS, 497)
XCTAssertEqual(HTTPStatusCode.tokenExpired, 498)
XCTAssertEqual(HTTPStatusCode.nginxClientClosedRequest, 499)
XCTAssertEqual(HTTPStatusCode.internalServerError, 500)
XCTAssertEqual(HTTPStatusCode.notImplemented, 501)
XCTAssertEqual(HTTPStatusCode.badGateway, 502)
XCTAssertEqual(HTTPStatusCode.serviceUnavailable, 503)
XCTAssertEqual(HTTPStatusCode.gatewayTimeout, 504)
XCTAssertEqual(HTTPStatusCode.httpVersionNotSupported, 505)
XCTAssertEqual(HTTPStatusCode.variantAlsoNegotiates, 506)
XCTAssertEqual(HTTPStatusCode.insufficientStorage, 507)
XCTAssertEqual(HTTPStatusCode.loopDetected, 508)
XCTAssertEqual(HTTPStatusCode.bandwidthLimitExceeded, 509)
XCTAssertEqual(HTTPStatusCode.notExtended, 510)
XCTAssertEqual(HTTPStatusCode.networkAuthenticationRequired, 511)
XCTAssertEqual(HTTPStatusCode.siteIsFrozen, 530)
XCTAssertEqual(HTTPStatusCode.networkConnectTimeoutError, 599)

XCTAssertEqual(HTTPURLResponse(url: URL(string: "http://www.google.com")!, statusCode: .ok, httpVersion: nil, headerFields: nil)!.statusCodeValue, .ok)
}
}

#endif

0 comments on commit fc31778

Please sign in to comment.