2
0
onevcat 8 жил өмнө
parent
commit
218001eb83

+ 4 - 4
Tests/KingfisherTests/ImageCacheTests.swift

@@ -76,7 +76,7 @@ class ImageCacheTests: XCTestCase {
         let expectation = self.expectation(description: "wait for clearing disk cache")
         let key = testKeys[0]
         
-        cache.store(testImage, original: testImageData as Data?, forKey: key, toDisk: true) { () -> () in
+        cache.store(testImage, original: testImageData as Data, forKey: key, toDisk: true) {
             self.cache.clearMemoryCache()
             let cacheResult = self.cache.imageCachedType(forKey: key)
             XCTAssertTrue(cacheResult.cached, "Should be cached")
@@ -94,7 +94,7 @@ class ImageCacheTests: XCTestCase {
     func testClearMemoryCache() {
         let expectation = self.expectation(description: "wait for retrieving image")
         
-        cache.store(testImage, original: testImageData as Data?, forKey: testKeys[0], toDisk: true) { () -> () in
+        cache.store(testImage, original: testImageData as Data, forKey: testKeys[0], toDisk: true) { () -> () in
             self.cache.clearMemoryCache()
             self.cache.retrieveImage(forKey: testKeys[0], options: nil, completionHandler: { (image, type) -> () in
                 XCTAssert(image != nil && type == .disk, "Should be cached in disk. But \(type)")
@@ -263,7 +263,7 @@ class ImageCacheTests: XCTestCase {
         let expectation = self.expectation(description: "wait for caching image")
         
         XCTAssert(self.cache.imageCachedType(forKey: testKeys[0]).cached == false, "This image should not be cached yet.")
-        self.cache.store(testImage, original: testImageData as Data?, forKey: testKeys[0], toDisk: true) { () -> () in
+        self.cache.store(testImage, original: testImageData as Data, forKey: testKeys[0], toDisk: true) { () -> () in
             XCTAssert(self.cache.imageCachedType(forKey: testKeys[0]).cached == true, "This image should be already cached.")
             expectation.fulfill()
         }
@@ -274,7 +274,7 @@ class ImageCacheTests: XCTestCase {
     func testRetrievingImagePerformance() {
 
         let expectation = self.expectation(description: "wait for retrieving image")
-        self.cache.store(testImage, original: testImageData as Data?, forKey: testKeys[0], toDisk: true) { () -> () in
+        self.cache.store(testImage, original: testImageData as Data, forKey: testKeys[0], toDisk: true) { () -> () in
             self.measure({ () -> Void in
                 for _ in 1 ..< 200 {
                     _ = self.cache.retrieveImageInDiskCache(forKey: testKeys[0])

+ 1 - 1
Tests/KingfisherTests/ImageProcessorTests.swift

@@ -49,7 +49,7 @@ class ImageProcessorTests: XCTestCase {
     }
     
     func testRenderEqual() {
-        let image1 = Image(data: testImageData! as Data)!
+        let image1 = Image(data: testImageData as Data)!
         let image2 = Image(data: testImagePNGData)!
         
         XCTAssertTrue(image1.renderEqual(to: image2))

+ 1 - 1
Tests/KingfisherTests/ImageViewExtensionTests.swift

@@ -392,7 +392,7 @@ class ImageViewExtensionTests: XCTestCase {
     
     func testCanUseImageIndicatorViewAnimating() {
         
-        imageView.kf.indicatorType = .image(imageData: testImageData! as Data)
+        imageView.kf.indicatorType = .image(imageData: testImageData as Data)
         XCTAssertTrue(imageView.kf.indicator is ImageIndicator)
         let image = (imageView.kf.indicator?.view as? ImageView)?.image
         XCTAssertNotNil(image)

+ 2 - 2
Tests/KingfisherTests/KingfisherManagerTests.swift

@@ -366,7 +366,7 @@ class KingfisherManagerTests: XCTestCase {
         let expectation = self.expectation(description: "waiting for downloading finished")
         
         let URLString = testKeys[0]
-        manager.cache.store(testImage, original: testImageData! as Data,
+        manager.cache.store(testImage, original: testImageData as Data,
                             forKey: URLString, processorIdentifier: DefaultImageProcessor.default.identifier,
                             cacheSerializer: DefaultCacheSerializer.default, toDisk: true)
         {
@@ -431,7 +431,7 @@ class KingfisherManagerTests: XCTestCase {
         // Clear original cache first.
         originalCache.clearMemoryCache()
         originalCache.clearDiskCache {
-            originalCache.store(testImage, original: testImageData! as Data,
+            originalCache.store(testImage, original: testImageData as Data,
                                 forKey: URLString, processorIdentifier: DefaultImageProcessor.default.identifier,
                                 cacheSerializer: DefaultCacheSerializer.default, toDisk: true)
             {

Файлын зөрүү хэтэрхий том тул дарагдсан байна
+ 0 - 0
Tests/KingfisherTests/KingfisherTestHelper.swift


Энэ ялгаанд хэт олон файл өөрчлөгдсөн тул зарим файлыг харуулаагүй болно