forked from nytimes/NYTPhotoViewer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
NYTPhotosOverlayViewTests.m
52 lines (42 loc) · 2.04 KB
/
NYTPhotosOverlayViewTests.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
//
// NYTPhotosOverlayViewTests.m
// NYTPhotoViewer
//
// Created by Brian Capps on 2/26/15.
// Copyright (c) 2015 NYTimes. All rights reserved.
//
@import UIKit;
@import XCTest;
#import <NYTPhotoViewer/NYTPhotosOverlayView.h>
@interface NYTPhotosOverlayViewTests : XCTestCase
@end
@implementation NYTPhotosOverlayViewTests
- (void)testNavigationBarExistsAfterInitialization {
NYTPhotosOverlayView *overlayView = [[NYTPhotosOverlayView alloc] init];
XCTAssertNotNil(overlayView.navigationBar);
}
- (void)testLeftBarButtonItemSetterAffectsNavigationBar {
NYTPhotosOverlayView *overlayView = [[NYTPhotosOverlayView alloc] init];
UIBarButtonItem *leftBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemDone target:nil action:nil];
overlayView.leftBarButtonItem = leftBarButtonItem;
XCTAssertEqualObjects(leftBarButtonItem, [overlayView.navigationBar.items.firstObject leftBarButtonItem]);
}
- (void)testRightBarButtonItemSetterAffectsNavigationBar {
NYTPhotosOverlayView *overlayView = [[NYTPhotosOverlayView alloc] init];
UIBarButtonItem *rightBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemDone target:nil action:nil];
overlayView.rightBarButtonItem = rightBarButtonItem;
XCTAssertEqualObjects(rightBarButtonItem, [overlayView.navigationBar.items.firstObject rightBarButtonItem]);
}
- (void)testTitleSetterAffectsNavigationBar {
NYTPhotosOverlayView *overlayView = [[NYTPhotosOverlayView alloc] init];
NSString *title = @"title";
overlayView.title = title;
XCTAssertEqualObjects(title, [overlayView.navigationBar.items.firstObject title]);
}
- (void)testTitleTextAttributesSetterAffectsNavigationBar {
NYTPhotosOverlayView *overlayView = [[NYTPhotosOverlayView alloc] init];
NSDictionary *titleTextAttributes = @{NSForegroundColorAttributeName: [UIColor orangeColor]};
overlayView.titleTextAttributes = titleTextAttributes;
XCTAssertEqualObjects(titleTextAttributes, overlayView.navigationBar.titleTextAttributes);
}
@end