Skip to content

Commit 9de86ff

Browse files
committed
Add some test for SDWebImageFIRStorageLoader
1 parent 1043b0c commit 9de86ff

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
@@ -113,4 +113,24 @@ - (void)testItCancelsTheCurrentDownloadWhenSettingAnImage {
113113
OCMVerify([download cancel]);
114114
}
115115

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

0 commit comments

Comments
 (0)