Skip to content

Commit 3875e60

Browse files
author
Christian Elies
committed
test(): implemented default remote image cache tests
1 parent 606c7bb commit 3875e60

File tree

3 files changed

+29
-16
lines changed

3 files changed

+29
-16
lines changed

Tests/RemoteImageTests/RemoteImageTests.swift

Lines changed: 0 additions & 15 deletions
This file was deleted.
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
//
2+
// DefaultRemoteImageCacheTests.swift
3+
// RemoteImageTests
4+
//
5+
// Created by Christian Elies on 14.12.19.
6+
//
7+
8+
@testable import RemoteImage
9+
import XCTest
10+
11+
final class DefaultRemoteImageCacheTests: XCTestCase {
12+
let remoteImageCache = DefaultRemoteImageCache()
13+
14+
override func setUp() {
15+
remoteImageCache.cache.removeAllObjects()
16+
}
17+
18+
func testSetImage() {
19+
let key = "Test" as NSString
20+
let image = PlatformSpecificImageType()
21+
remoteImageCache.setObject(image, forKey: key)
22+
XCTAssertEqual(remoteImageCache.object(forKey: key), image)
23+
}
24+
25+
static var allTests = [
26+
("testSetImage", testSetImage)
27+
]
28+
}

Tests/RemoteImageTests/XCTestManifests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import XCTest
33
#if !canImport(ObjectiveC)
44
public func allTests() -> [XCTestCaseEntry] {
55
return [
6-
testCase(RemoteImageTests.allTests),
6+
testCase(DefaultRemoteImageCacheTests.allTests)
77
]
88
}
99
#endif

0 commit comments

Comments
 (0)