Skip to content

Commit

Permalink
Tests for notification and block use
Browse files Browse the repository at this point in the history
  • Loading branch information
Caelin Jackson-King committed Jun 29, 2018
1 parent aed00d3 commit c4caddc
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Tests/Tests/AFURLSessionManagerTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,12 @@ - (void)testSessionTaskDoesReportMetrics {
#endif
return YES;
}];

__weak XCTestExpectation *metricsBlock = [self expectationWithDescription:@"Metrics completion block is called"];
[self.localManager setTaskDidFinishCollectingMetricsBlock:^(NSURLSession * _Nonnull session, NSURLSessionTask * _Nonnull task, NSURLSessionTaskMetrics * _Nullable metrics) {
[metricsBlock fulfill];
}];

NSURLSessionTask *task = [self.localManager downloadTaskWithRequest:[self bigImageURLRequest]
progress:nil
destination:nil
Expand Down

0 comments on commit c4caddc

Please sign in to comment.