Skip to content

Commit e13a74e

Browse files
committed
Add some test for SDWebImageFIRStorageLoader
1 parent c3e7796 commit e13a74e

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

Storage/FirebaseStorageUITests/FUIImageViewCategoryTests.m

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,4 +112,24 @@ - (void)testItCancelsTheCurrentDownloadWhenSettingAnImage {
112112
OCMVerify([download cancel]);
113113
}
114114

115+
- (void)testLoaderWithNilStorageReference {
116+
[SDWebImageFIRStorageLoader.sharedLoader loadImageWithURL:nil
117+
options:0
118+
context:nil
119+
progress:nil
120+
completed:^(UIImage * _Nullable image, NSData * _Nullable data, NSError * _Nullable error, BOOL finished) {
121+
XCTAssertNil(image);
122+
XCTAssertNotNil(error);
123+
}];
124+
NSURL *httpURL = [NSURL URLWithString:@"www.google.com"];
125+
[SDWebImageFIRStorageLoader.sharedLoader loadImageWithURL:httpURL
126+
options:0
127+
context:nil
128+
progress:nil
129+
completed:^(UIImage * _Nullable image, NSData * _Nullable data, NSError * _Nullable error, BOOL finished) {
130+
XCTAssertNil(image);
131+
XCTAssertNotNil(error);
132+
}];
133+
}
134+
115135
@end

0 commit comments

Comments
 (0)