Skip to content
This repository has been archived by the owner on Jan 2, 2020. It is now read-only.

Commit

Permalink
Fixed nullability mistake: actionTitles are non-null
Browse files Browse the repository at this point in the history
  • Loading branch information
jonreid committed Mar 6, 2017
1 parent f554a43 commit 564f7b0
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 11 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ Version 2.0.1
-------------
_06 Mar 2017_

- Fixed nullability mistake: actionTitles are non-null.
- Add shared scheme to satisfy latest version of Carthage.


Expand Down
20 changes: 10 additions & 10 deletions SampleSwift/Tests/ViewControllerTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -90,21 +90,21 @@ class ViewControllerTests: XCTestCase {
func testShowAlert_PresentedAlertShouldHaveActions() {
sut.showAlertButton.sendActions(for: .touchUpInside)

XCTAssertEqual(alertVerifier.actionTitles?.count, 4);
XCTAssertEqual(alertVerifier.actionTitles?[0] as? String, "No Handler");
XCTAssertEqual(alertVerifier.actionTitles?[1] as? String, "Default");
XCTAssertEqual(alertVerifier.actionTitles?[2] as? String, "Cancel");
XCTAssertEqual(alertVerifier.actionTitles?[3] as? String, "Destroy");
XCTAssertEqual(alertVerifier.actionTitles.count, 4);
XCTAssertEqual(alertVerifier.actionTitles[0] as? String, "No Handler");
XCTAssertEqual(alertVerifier.actionTitles[1] as? String, "Default");
XCTAssertEqual(alertVerifier.actionTitles[2] as? String, "Cancel");
XCTAssertEqual(alertVerifier.actionTitles[3] as? String, "Destroy");
}

func testShowActionSheet_PresentedActionSheetShouldHaveActions() {
sut.showActionSheetButton.sendActions(for: .touchUpInside)

XCTAssertEqual(alertVerifier.actionTitles?.count, 4);
XCTAssertEqual(alertVerifier.actionTitles?[0] as? String, "No Handler");
XCTAssertEqual(alertVerifier.actionTitles?[1] as? String, "Default");
XCTAssertEqual(alertVerifier.actionTitles?[2] as? String, "Cancel");
XCTAssertEqual(alertVerifier.actionTitles?[3] as? String, "Destroy");
XCTAssertEqual(alertVerifier.actionTitles.count, 4);
XCTAssertEqual(alertVerifier.actionTitles[0] as? String, "No Handler");
XCTAssertEqual(alertVerifier.actionTitles[1] as? String, "Default");
XCTAssertEqual(alertVerifier.actionTitles[2] as? String, "Cancel");
XCTAssertEqual(alertVerifier.actionTitles[3] as? String, "Destroy");
}

func testShowAlert_DefaultButtonShouldHaveDefaultStyle() {
Expand Down
2 changes: 1 addition & 1 deletion Source/MockUIAlertController/QCOMockAlertVerifier.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ NS_ASSUME_NONNULL_BEGIN
@property (nullable, nonatomic, copy) NSString *title;
@property (nullable, nonatomic, copy) NSString *message;
@property (nonatomic, assign) UIAlertControllerStyle preferredStyle;
@property (nullable, nonatomic, readonly) NSArray *actionTitles;
@property (nonatomic, readonly) NSArray *actionTitles;
@property (nullable, nonatomic, strong) QCOMockPopoverPresentationController *popover;

/*!
Expand Down

0 comments on commit 564f7b0

Please sign in to comment.