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

Commit

Permalink
Flesh out examples by asserted presentedCount
Browse files Browse the repository at this point in the history
  • Loading branch information
jonreid committed Feb 11, 2019
1 parent 1e93a43 commit 18a1a07
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Nothing.
Information about the alert or action sheet is then available through the
[QCOMockAlertVerifier](https://github.com/jonreid/MockUIAlertController/blob/master/Source/MockUIAlertController/QCOMockAlertVerifier.h).

For example, here's a test verifying the title. `sut` is the System Under Test
For example, here's a test verifying the title (and that the alert is presented exactly once). `sut` is the System Under Test
in the test fixture.

```swift
Expand All @@ -43,7 +43,8 @@ func test_showAlert_alertShouldHaveTitle() {

sut.showAlert() // Whatever triggers the alert

XCTAssertEqual(alertVerifier.title, "Title")
XCTAssertEqual(alertVerifier.presentedCount, 1, "presented count")
XCTAssertEqual(alertVerifier.title, "Hello!", "title")
}
```

Expand All @@ -53,7 +54,8 @@ func test_showAlert_alertShouldHaveTitle() {

[sut showAlert]; // Whatever triggers the alert

XCTAssertEqualObjects(alertVerifier.title, @"Title");
XCTAssertEqualObjects(alertVerifier.presentedCount, 1, @"presented count");
XCTAssertEqualObjects(alertVerifier.title, @"Hello!", @"title");
}
```

Expand Down

0 comments on commit 18a1a07

Please sign in to comment.