-
Notifications
You must be signed in to change notification settings - Fork 296
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add UnitTests
for PayPalNativeCheckout
Module
#1144
Conversation
…nd BTPayPalNativeCheckoutStartable for testing MXO; update implimentation
# Conflicts: # Sources/BraintreePayPalNativeCheckout/BTPayPalNativeCheckoutClient.swift
UnitTests/BraintreePayPalNativeCheckoutTests/BTPayPalNativeCheckoutProvider_Tests.swift
Outdated
Show resolved
Hide resolved
UnitTests/BraintreePayPalNativeCheckoutTests/BTPayPalNativeCheckoutClient_Tests.swift
Outdated
Show resolved
Hide resolved
UnitTests/BraintreePayPalNativeCheckoutTests/BTPayPalNativeCheckoutClient_Tests.swift
Outdated
Show resolved
Hide resolved
…ckoutClient_Tests.swift Co-authored-by: scannillo <[email protected]>
XCTAssertEqual(error.domain, BTPayPalNativeCheckoutError.errorDomain) | ||
XCTAssertEqual(error.code, BTPayPalNativeCheckoutError.orderCreationFailed(BTPayPalNativeCheckoutError.invalidJSONResponse).errorCode) | ||
XCTAssertEqual(error.localizedDescription, BTPayPalNativeCheckoutError.orderCreationFailed(BTPayPalNativeCheckoutError.invalidJSONResponse).errorDescription) | ||
expectation.fulfill() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nitpick - I think ideally the tests should assert on the raw string values & raw int codes expected, versus referring to constants in the SDK. Otherwise we don't catch spelling errors or typos.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done: 2325569
Do we think it's worth documenting this somewhere? Not sure if the style guide or elsewhere is best.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left a small comment re: asserting on raw strings vs internal constants, but LGTM!
Thanks for doing this really tricky/tedious work 👏
Summary of changes
BTPayPalNativeCheckoutStartable
(PPCP version)BTPayPalNativeCheckoutProvider
(PPCP version)BTPayPalNativeCheckoutProtocol
(PPCP version)BTPayPalNativeCheckoutProvider_Tests
and add additional unit tests toBTPayPalNativeCheckoutClient_Tests
- many of the added tests are 1:1 with the tests for this module on PPCPChecklist
[ ] Added a changelog entryAuthors