Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
shopify_iossdk
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
cemarose
shopify_iossdk
Commits
c38130d6
Commit
c38130d6
authored
Oct 08, 2015
by
Rune Madsen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add tests for product tags
parent
1d8f991f
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
35 additions
and
2 deletions
+35
-2
BUYClientTest_Storefront.m
...e Buy SDK/Mobile Buy SDK Tests/BUYClientTest_Storefront.m
+33
-0
BUYIntegrationTest.m
Mobile Buy SDK/Mobile Buy SDK Tests/BUYIntegrationTest.m
+2
-2
mocked_responses.json
Mobile Buy SDK/Mobile Buy SDK Tests/mocked_responses.json
+0
-0
No files found.
Mobile Buy SDK/Mobile Buy SDK Tests/BUYClientTest_Storefront.m
View file @
c38130d6
...
...
@@ -245,4 +245,37 @@
}];
}
-
(
void
)
testValidTags
{
[
OHHTTPStubs
stubRequestsPassingTest
:
^
BOOL
(
NSURLRequest
*
_Nonnull
request
)
{
return
[
self
shouldUseMocks
];
}
withStubResponse
:
^
OHHTTPStubsResponse
*
_Nonnull
(
NSURLRequest
*
_Nonnull
request
)
{
return
[
OHHTTPStubsResponse
responseWithKey
:
@"testGetValidTag_0"
];
}];
XCTestExpectation
*
expectation
=
[
self
expectationWithDescription
:
NSStringFromSelector
(
_cmd
)];
[
self
.
client
getProductsPage
:
1
completion
:
^
(
NSArray
*
products
,
NSUInteger
page
,
BOOL
reachedEnd
,
NSError
*
error
)
{
XCTAssertNil
(
error
);
XCTAssertNotNil
(
products
);
if
(
products
.
count
>
0
)
{
BUYProduct
*
product
=
products
[
0
];
if
(
product
.
tags
)
{
XCTAssertTrue
([
product
.
tags
isKindOfClass
:[
NSSet
class
]]);
for
(
NSString
*
tag
in
[
product
.
tags
allObjects
])
{
XCTAssert
([
tag
isKindOfClass
:[
NSString
class
]]);
}
}
}
[
expectation
fulfill
];
}];
[
self
waitForExpectationsWithTimeout
:
10
handler
:
^
(
NSError
*
error
)
{
XCTAssertNil
(
error
);
}];
}
@end
Mobile Buy SDK/Mobile Buy SDK Tests/BUYIntegrationTest.m
View file @
c38130d6
...
...
@@ -248,7 +248,7 @@
[
OHHTTPStubs
stubRequestsPassingTest
:
^
BOOL
(
NSURLRequest
*
_Nonnull
request
)
{
return
[
self
shouldUseMocks
];
}
withStubResponse
:
^
OHHTTPStubsResponse
*
_Nonnull
(
NSURLRequest
*
_Nonnull
request
)
{
return
[
OHHTTPStubsResponse
responseWithKey
:
@"testCheckoutFlowUsingCreditCard_1
7
"
];
return
[
OHHTTPStubsResponse
responseWithKey
:
@"testCheckoutFlowUsingCreditCard_1
4
"
];
}];
__block
BUYStatus
checkoutStatus
=
BUYStatusUnknown
;
...
...
@@ -285,7 +285,7 @@
[
OHHTTPStubs
stubRequestsPassingTest
:
^
BOOL
(
NSURLRequest
*
_Nonnull
request
)
{
return
[
self
shouldUseMocks
];
}
withStubResponse
:
^
OHHTTPStubsResponse
*
_Nonnull
(
NSURLRequest
*
_Nonnull
request
)
{
return
[
OHHTTPStubsResponse
responseWithKey
:
@"testCheckoutFlowUsingCreditCard_1
8
"
];
return
[
OHHTTPStubsResponse
responseWithKey
:
@"testCheckoutFlowUsingCreditCard_1
5
"
];
}];
XCTestExpectation
*
expectation
=
[
self
expectationWithDescription
:
NSStringFromSelector
(
_cmd
)];
...
...
Mobile Buy SDK/Mobile Buy SDK Tests/mocked_responses.json
View file @
c38130d6
This source diff could not be displayed because it is too large. You can
view the blob
instead.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment