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
e2fbdf60
Commit
e2fbdf60
authored
8 years ago
by
Brent Gulanowski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add test for UIFont Additions.
parent
f0a5adf7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
54 additions
and
0 deletions
+54
-0
BUYFontAdditionsTests.m
Mobile Buy SDK/Mobile Buy SDK Tests/BUYFontAdditionsTests.m
+50
-0
project.pbxproj
Mobile Buy SDK/Mobile Buy SDK.xcodeproj/project.pbxproj
+4
-0
No files found.
Mobile Buy SDK/Mobile Buy SDK Tests/BUYFontAdditionsTests.m
0 → 100644
View file @
e2fbdf60
//
// BUYFontAdditionsTests.m
// Mobile Buy SDK
//
// Created by Shopify.
// Copyright (c) 2015 Shopify Inc. All rights reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
//
#import <XCTest/XCTest.h>
#import "UIFont+BUYAdditions.h"
@interface
BUYFontAdditionsTests
:
XCTestCase
@end
@implementation
BUYFontAdditionsTests
-
(
void
)
testIncreasedFontSize
{
static
CGFloat
const
increase
=
2
.
0
;
UIFont
*
font
=
[
UIFont
preferredFontForTextStyle
:
UIFontTextStyleBody
];
CGFloat
newSize
=
font
.
pointSize
+
increase
;
NSMutableDictionary
*
attributes
=
[
font
.
fontDescriptor
.
fontAttributes
mutableCopy
];
attributes
[
UIFontDescriptorSizeAttribute
]
=
@
(
newSize
);
UIFont
*
expected
=
[
UIFont
fontWithDescriptor
:[
UIFontDescriptor
fontDescriptorWithFontAttributes
:
attributes
]
size
:
newSize
];
UIFont
*
actual
=
[
UIFont
preferredFontForTextStyle
:
UIFontTextStyleBody
increasedPointSize
:
increase
];
XCTAssertEqualObjects
(
actual
,
expected
);
}
@end
This diff is collapsed.
Click to expand it.
Mobile Buy SDK/Mobile Buy SDK.xcodeproj/project.pbxproj
View file @
e2fbdf60
...
...
@@ -79,6 +79,7 @@
849110351CCE70CE00E53B93
/* BUYDictionaryAdditionsTests.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
849110341CCE70CE00E53B93
/* BUYDictionaryAdditionsTests.m */
;
};
8491103A1CCE718100E53B93
/* BUYExceptionAdditionsTests.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
849110391CCE718100E53B93
/* BUYExceptionAdditionsTests.m */
;
};
8491103C1CCE731900E53B93
/* BUYURLAdditionsTests.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
8491103B1CCE731900E53B93
/* BUYURLAdditionsTests.m */
;
};
8491103E1CCE988600E53B93
/* BUYFontAdditionsTests.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
8491103D1CCE988600E53B93
/* BUYFontAdditionsTests.m */
;
};
9003969B1B601DF400226B73
/* BUYCartLineItem.h in Headers */
=
{
isa
=
PBXBuildFile
;
fileRef
=
900396991B601DF400226B73
/* BUYCartLineItem.h */
;
settings
=
{
ATTRIBUTES
=
(
Public
,
);
};
};
9003969C1B601DF400226B73
/* BUYCartLineItem.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
9003969A1B601DF400226B73
/* BUYCartLineItem.m */
;
};
900396AC1B627CB900226B73
/* BUYProductView.h in Headers */
=
{
isa
=
PBXBuildFile
;
fileRef
=
900396AA1B627CB900226B73
/* BUYProductView.h */
;
};
...
...
@@ -406,6 +407,7 @@
849110341CCE70CE00E53B93
/* BUYDictionaryAdditionsTests.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
BUYDictionaryAdditionsTests.m
;
sourceTree
=
"<group>"
;
};
849110391CCE718100E53B93
/* BUYExceptionAdditionsTests.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
BUYExceptionAdditionsTests.m
;
sourceTree
=
"<group>"
;
};
8491103B1CCE731900E53B93
/* BUYURLAdditionsTests.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
BUYURLAdditionsTests.m
;
sourceTree
=
"<group>"
;
};
8491103D1CCE988600E53B93
/* BUYFontAdditionsTests.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
BUYFontAdditionsTests.m
;
sourceTree
=
"<group>"
;
};
900396991B601DF400226B73
/* BUYCartLineItem.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
BUYCartLineItem.h
;
sourceTree
=
"<group>"
;
};
9003969A1B601DF400226B73
/* BUYCartLineItem.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
BUYCartLineItem.m
;
sourceTree
=
"<group>"
;
};
900396AA1B627CB900226B73
/* BUYProductView.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
lineEnding
=
0
;
name
=
BUYProductView.h
;
path
=
"Product View/BUYProductView.h"
;
sourceTree
=
"<group>"
;
xcLanguageSpecificationIdentifier
=
xcode.lang.objcpp
;
};
...
...
@@ -661,6 +663,7 @@
BEB9AE7C1BA8685600575F8A
/* BUYClientTestBase.m */
,
849110341CCE70CE00E53B93
/* BUYDictionaryAdditionsTests.m */
,
849110391CCE718100E53B93
/* BUYExceptionAdditionsTests.m */
,
8491103D1CCE988600E53B93
/* BUYFontAdditionsTests.m */
,
90F592F81B0D5F4C0026B382
/* BUYIntegrationTest.m */
,
90F592FE1B0D5F4C0026B382
/* BUYLineItemTest.m */
,
90F592FF1B0D5F4C0026B382
/* BUYObjectTests.m */
,
...
...
@@ -1331,6 +1334,7 @@
buildActionMask
=
2147483647
;
files
=
(
BEB9AE7D1BA885E300575F8A
/* BUYClientTestBase.m in Sources */
,
8491103E1CCE988600E53B93
/* BUYFontAdditionsTests.m in Sources */
,
BEB9AE7B1BA866D000575F8A
/* BUYClientTestBase.h in Sources */
,
8491103A1CCE718100E53B93
/* BUYExceptionAdditionsTests.m in Sources */
,
849110351CCE70CE00E53B93
/* BUYDictionaryAdditionsTests.m in Sources */
,
...
...
This diff is collapsed.
Click to expand it.
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