Skip to content

Commit 92f9d63

Browse files
author
Ian Gordon
committed
Add Switch Tests
Reviewers: #material_components_ios_owners, featherless Reviewed By: #material_components_ios_owners, featherless Projects: #material_components_ios_owners Differential Revision: http://codereview.cc/D80
1 parent 43cc308 commit 92f9d63

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

components/Switch/SwitchTests/SwitchTests.m

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,20 @@ - (void)tearDown {
3636
[super tearDown];
3737
}
3838

39+
- (void)testSetOn {
40+
MDCSwitch *testSwitch = [[MDCSwitch alloc] initWithFrame:CGRectZero];
41+
testSwitch.on = YES;
42+
43+
XCTAssertEqual(testSwitch.on, YES, @"MDCSwitch.on should be YES");
44+
}
45+
46+
- (void)testSetOff {
47+
MDCSwitch *testSwitch = [[MDCSwitch alloc] initWithFrame:CGRectZero];
48+
testSwitch.on = NO;
49+
50+
XCTAssertEqual(testSwitch.on, NO, @"MDCSwitch.on should be NO");
51+
}
52+
3953
- (void)testConstantSize {
4054
MDCSwitch *testZeroSwitch = [[MDCSwitch alloc] initWithFrame:CGRectZero];
4155
MDCSwitch *testSmallSwitch = [[MDCSwitch alloc] initWithFrame:CGRectMake(0.0, 0.0, 4.0, 4.0)];

0 commit comments

Comments
 (0)