Documented the AssetPrefix enumeration in the library target.
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
import Testing
|
||||
|
||||
@testable import AppLibrary
|
||||
|
||||
@Suite("AssetPrefix")
|
||||
struct AssetPrefixTests {
|
||||
|
||||
// MARK: Properties tests
|
||||
|
||||
@Test(arguments: zip(AssetPrefix.allCases, [String].paths))
|
||||
func path(
|
||||
for prefix: AssetPrefix,
|
||||
expects pathExpected: String
|
||||
) async throws {
|
||||
// GIVEN
|
||||
// WHEN
|
||||
let path = prefix.path
|
||||
|
||||
// THEN
|
||||
#expect(path == pathExpected)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// MARK: - Collection+Strings
|
||||
|
||||
private extension Collection where Element == String {
|
||||
|
||||
// MARK: Properties
|
||||
|
||||
static var paths: [Element] {[
|
||||
"/css",
|
||||
"/data",
|
||||
"/downloads",
|
||||
"/images",
|
||||
"/img",
|
||||
"/index",
|
||||
"/js",
|
||||
"/videos"
|
||||
]}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user