2025-03-05 00:04:07 +01:00
|
|
|
import Testing
|
|
|
|
|
|
|
|
@testable import AppLibrary
|
|
|
|
|
2025-03-05 00:09:28 +01:00
|
|
|
@Suite("StaticFile", .tags(.enumeration))
|
2025-03-05 00:04:07 +01:00
|
|
|
struct StaticFileTests {
|
|
|
|
|
2025-03-07 22:14:25 +01:00
|
|
|
// MARK: Properties tests
|
|
|
|
|
2025-03-05 00:04:07 +01:00
|
|
|
@Test(arguments: zip(StaticFile.allCases, [String].paths))
|
|
|
|
func path(
|
|
|
|
for prefix: StaticFile,
|
|
|
|
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] {[
|
|
|
|
"/data/documentation.json",
|
|
|
|
"/favicon.ico",
|
|
|
|
"/favicon.svg",
|
|
|
|
"/theme-settings.json"
|
|
|
|
]}
|
|
|
|
|
|
|
|
}
|