2025-03-04 23:36:04 +01:00
|
|
|
import Testing
|
|
|
|
|
|
|
|
@testable import AppLibrary
|
|
|
|
|
2025-03-05 00:09:28 +01:00
|
|
|
@Suite("AssetPrefix", .tags(.enumeration))
|
2025-03-04 23:36:04 +01:00
|
|
|
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] {[
|
2025-03-08 12:26:11 +01:00
|
|
|
"/css/",
|
|
|
|
"/data/",
|
|
|
|
"/downloads/",
|
|
|
|
"/images/",
|
|
|
|
"/img/",
|
|
|
|
"/index/",
|
|
|
|
"/js/",
|
|
|
|
"/videos/"
|
2025-03-04 23:36:04 +01:00
|
|
|
]}
|
|
|
|
|
|
|
|
}
|