diff --git a/Library/Sources/Internal/Enumerations/IndexPrefix.swift b/Library/Sources/Internal/Enumerations/IndexPrefix.swift index 87ecb40..00366a0 100644 --- a/Library/Sources/Internal/Enumerations/IndexPrefix.swift +++ b/Library/Sources/Internal/Enumerations/IndexPrefix.swift @@ -1,5 +1,8 @@ +/// An enumeration that represents the folders where articles and tutorials data and assets will be stored. enum IndexPrefix: String, CaseIterable { + /// A folder that contains all articles' assets and data generated is stored. case documentation + /// A folder that contains all tutorials' assets and data generated is stored. case tutorials } @@ -10,7 +13,7 @@ extension IndexPrefix: Pathable { // MARK: Computed var path: String { - .init(format: .Format.pathRoot, rawValue) + .init(format: .Format.Path.root, rawValue) } } diff --git a/Test/Sources/Cases/Internal/Enumerations/IndexPrefixTests.swift b/Test/Sources/Cases/Internal/Enumerations/IndexPrefixTests.swift new file mode 100644 index 0000000..09e76b9 --- /dev/null +++ b/Test/Sources/Cases/Internal/Enumerations/IndexPrefixTests.swift @@ -0,0 +1,34 @@ +import Testing + +@testable import AppLibrary + +@Suite("IndexPrefix") +struct IndexPrefixTests { + + @Test(arguments: zip(IndexPrefix.allCases, [String].paths)) + func path( + for prefix: IndexPrefix, + 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] {[ + "/documentation", + "/tutorials" + ]} + +}