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
9ae0dc11
Commit
9ae0dc11
authored
May 05, 2016
by
Dima Bart
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clean up client tests: remove nullability, reduce indentation.
parent
25fc9987
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
23 deletions
+25
-23
BUYClientTest.m
Mobile Buy SDK/Mobile Buy SDK Tests/BUYClientTest.m
+25
-23
No files found.
Mobile Buy SDK/Mobile Buy SDK Tests/BUYClientTest.m
View file @
9ae0dc11
...
@@ -327,15 +327,16 @@ NSString * const BUYFakeCustomerToken = @"dsfasdgafdg";
...
@@ -327,15 +327,16 @@ NSString * const BUYFakeCustomerToken = @"dsfasdgafdg";
-
(
void
)
testCustomerCreationURL
-
(
void
)
testCustomerCreationURL
{
{
BUYAccountCredentials
*
credentials
=
[
BUYAccountCredentials
credentialsWithItems
:@[
NSArray
*
items
=
@[
[
BUYAccountCredentialItem
itemWithFirstName
:
@"michael"
],
[
BUYAccountCredentialItem
itemWithFirstName
:
@"michael"
],
[
BUYAccountCredentialItem
itemWithLastName
:
@"scott"
],
[
BUYAccountCredentialItem
itemWithLastName
:
@"scott"
],
[
BUYAccountCredentialItem
itemWithEmail
:
@"fake@example.com"
],
[
BUYAccountCredentialItem
itemWithEmail
:
@"fake@example.com"
],
[
BUYAccountCredentialItem
itemWithPassword
:
@"password"
],
[
BUYAccountCredentialItem
itemWithPassword
:
@"password"
],
[
BUYAccountCredentialItem
itemWithPasswordConfirmation
:
@"password"
],
[
BUYAccountCredentialItem
itemWithPasswordConfirmation
:
@"password"
],
]];
];
BUYAccountCredentials
*
credentials
=
[
BUYAccountCredentials
credentialsWithItems
:
items
];
NSURLSessionDataTask
*
task
=
[
self
.
client
createCustomerWithCredentials
:
credentials
callback
:
^
(
BUYCustomer
*
_Nullable
customer
,
NSString
*
_Nullable
token
,
NSError
*
_Nullable
error
)
{
NSURLSessionDataTask
*
task
=
[
self
.
client
createCustomerWithCredentials
:
credentials
callback
:
^
(
BUYCustomer
*
customer
,
NSString
*
token
,
NSError
*
error
)
{
}];
}];
...
@@ -359,11 +360,12 @@ NSString * const BUYFakeCustomerToken = @"dsfasdgafdg";
...
@@ -359,11 +360,12 @@ NSString * const BUYFakeCustomerToken = @"dsfasdgafdg";
-
(
void
)
testLoginCustomerURL
-
(
void
)
testLoginCustomerURL
{
{
BUYAccountCredentials
*
credentials
=
[
BUYAccountCredentials
credentialsWithItems
:@[
NSArray
*
items
=
@[
[
BUYAccountCredentialItem
itemWithEmail
:
@"fake@example.com"
],
[
BUYAccountCredentialItem
itemWithEmail
:
@"fake@example.com"
],
[
BUYAccountCredentialItem
itemWithPassword
:
@"password"
],
[
BUYAccountCredentialItem
itemWithPassword
:
@"password"
],
]];
];
NSURLSessionDataTask
*
task
=
[
self
.
client
loginCustomerWithCredentials
:
credentials
callback
:
^
(
BUYCustomer
*
_Nullable
customer
,
NSString
*
_Nullable
token
,
NSError
*
_Nullable
error
)
{
BUYAccountCredentials
*
credentials
=
[
BUYAccountCredentials
credentialsWithItems
:
items
];
NSURLSessionDataTask
*
task
=
[
self
.
client
loginCustomerWithCredentials
:
credentials
callback
:
^
(
BUYCustomer
*
customer
,
NSString
*
token
,
NSError
*
error
)
{
}];
}];
...
@@ -384,7 +386,7 @@ NSString * const BUYFakeCustomerToken = @"dsfasdgafdg";
...
@@ -384,7 +386,7 @@ NSString * const BUYFakeCustomerToken = @"dsfasdgafdg";
-
(
void
)
testGetCustomerURL
-
(
void
)
testGetCustomerURL
{
{
NSURLSessionDataTask
*
task
=
[
self
.
client
getCustomerWithID
:
@""
callback
:
^
(
BUYCustomer
*
_Nullable
customer
,
NSError
*
_Nullable
error
)
{
NSURLSessionDataTask
*
task
=
[
self
.
client
getCustomerWithID
:
@""
callback
:
^
(
BUYCustomer
*
customer
,
NSError
*
error
)
{
}];
}];
...
@@ -397,7 +399,7 @@ NSString * const BUYFakeCustomerToken = @"dsfasdgafdg";
...
@@ -397,7 +399,7 @@ NSString * const BUYFakeCustomerToken = @"dsfasdgafdg";
-
(
void
)
testGetOrdersForCustomerURL
-
(
void
)
testGetOrdersForCustomerURL
{
{
NSURLSessionDataTask
*
task
=
[
self
.
client
getOrdersForCustomerWithCallback
:
^
(
NSArray
<
BUYOrder
*>
*
_Nullable
orders
,
NSError
*
_Nullable
error
)
{
NSURLSessionDataTask
*
task
=
[
self
.
client
getOrdersForCustomerWithCallback
:
^
(
NSArray
<
BUYOrder
*>
*
orders
,
NSError
*
error
)
{
}];
}];
...
@@ -435,7 +437,7 @@ NSString * const BUYFakeCustomerToken = @"dsfasdgafdg";
...
@@ -435,7 +437,7 @@ NSString * const BUYFakeCustomerToken = @"dsfasdgafdg";
XCTAssertNil
(
task
);
// task should be nil if no customer token was set on the client
XCTAssertNil
(
task
);
// task should be nil if no customer token was set on the client
self
.
client
.
customerToken
=
BUYFakeCustomerToken
;
self
.
client
.
customerToken
=
BUYFakeCustomerToken
;
task
=
[
self
.
client
renewCustomerTokenWithID
:
@"1"
callback
:
^
(
NSString
*
_Nullable
token
,
NSError
*
_Nullable
error
)
{
task
=
[
self
.
client
renewCustomerTokenWithID
:
@"1"
callback
:
^
(
NSString
*
token
,
NSError
*
error
)
{
}];
}];
...
@@ -446,14 +448,14 @@ NSString * const BUYFakeCustomerToken = @"dsfasdgafdg";
...
@@ -446,14 +448,14 @@ NSString * const BUYFakeCustomerToken = @"dsfasdgafdg";
-
(
void
)
testCustomerActivation
-
(
void
)
testCustomerActivation
{
{
NSArray
*
items
=
@[
BUYAccountCredentials
*
credentials
=
[
BUYAccountCredentials
credentialsWithItems
:@[
[
BUYAccountCredentialItem
itemWithPassword
:
@"12345"
],
[
BUYAccountCredentialItem
itemWithPassword
:
@"12345"
],
[
BUYAccountCredentialItem
itemWithPasswordConfirmation
:
@"12345"
],
[
BUYAccountCredentialItem
itemWithPasswordConfirmation
:
@"12345"
],
];
]
];
BUYAccountCredentials
*
credentials
=
[
BUYAccountCredentials
credentialsWithItems
:
items
];
NSString
*
customerID
=
@"12345"
;
NSString
*
customerID
=
@"12345"
;
NSString
*
customerToken
=
@"12345"
;
NSString
*
customerToken
=
@"12345"
;
NSURLSessionDataTask
*
task
=
[
self
.
client
activateCustomerWithCredentials
:
credentials
customerID
:
customerID
customerToken
:
customerToken
callback
:^
(
BUYCustomer
*
_Nullable
customer
,
NSString
*
_Nullable
token
,
NSError
*
_Nullable
error
)
{
NSURLSessionDataTask
*
task
=
[
self
.
client
activateCustomerWithCredentials
:
credentials
customerID
:
customerID
customerToken
:
customerToken
callback
:^
(
BUYCustomer
*
customer
,
NSString
*
token
,
NSError
*
error
)
{
}];
}];
...
...
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