forked from TextureGroup/Texture
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Tests] Introducing tests for the ASTabBarController (TextureGroup#628)
* introducing tests for the ASTabBarController * Update ASTabBarControllerTests.m
- Loading branch information
1 parent
cf4e028
commit 83097e8
Showing
2 changed files
with
49 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
// | ||
// ASTabBarControllerTests.m | ||
// Texture | ||
// | ||
// Copyright (c) 2017-present, Pinterest, Inc. All rights reserved. | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
|
||
#import <XCTest/XCTest.h> | ||
#import "ASTabBarController.h" | ||
#import "ASViewController.h" | ||
|
||
@interface ASTabBarControllerTests: XCTestCase | ||
|
||
@end | ||
|
||
@implementation ASTabBarControllerTests | ||
|
||
- (void)testTabBarControllerSelectIndex { | ||
ASViewController *firstViewController = [ASViewController new]; | ||
ASViewController *secondViewController = [ASViewController new]; | ||
NSArray *viewControllers = @[firstViewController, secondViewController]; | ||
ASTabBarController *tabBarController = [ASTabBarController new]; | ||
[tabBarController setViewControllers:viewControllers]; | ||
[tabBarController setSelectedIndex:1]; | ||
XCTAssertTrue([tabBarController.viewControllers isEqualToArray:viewControllers]); | ||
XCTAssertEqual(tabBarController.selectedViewController, secondViewController); | ||
} | ||
|
||
- (void)testTabBarControllerSelectViewController { | ||
ASViewController *firstViewController = [ASViewController new]; | ||
ASViewController *secondViewController = [ASViewController new]; | ||
NSArray *viewControllers = @[firstViewController, secondViewController]; | ||
ASTabBarController *tabBarController = [ASTabBarController new]; | ||
[tabBarController setViewControllers:viewControllers]; | ||
[tabBarController setSelectedViewController:secondViewController]; | ||
XCTAssertTrue([tabBarController.viewControllers isEqualToArray:viewControllers]); | ||
XCTAssertEqual(tabBarController.selectedViewController, secondViewController); | ||
} | ||
|
||
@end |