aboutsummaryrefslogtreecommitdiff
path: root/MapTests/StageTests.swift
diff options
context:
space:
mode:
authorRuben Beltran del Rio <git@r.bdr.sh>2025-07-04 17:06:28 +0200
committerRuben Beltran del Rio <git@r.bdr.sh>2025-07-04 17:06:28 +0200
commitc843d34f56c207abcf4b93e424125eea2dc601e0 (patch)
tree415dc2d9be4be31e290e1dd1dedb0b630c5e8fc6 /MapTests/StageTests.swift
parented10ac191df473c92c4fec495aafa7f569d108c8 (diff)
Upgrade to Swift 6
Diffstat (limited to 'MapTests/StageTests.swift')
-rw-r--r--MapTests/StageTests.swift119
1 files changed, 119 insertions, 0 deletions
diff --git a/MapTests/StageTests.swift b/MapTests/StageTests.swift
new file mode 100644
index 0000000..05812fe
--- /dev/null
+++ b/MapTests/StageTests.swift
@@ -0,0 +1,119 @@
+// Copyright (C) 2024 Rubén Beltrán del Río
+
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see https://map.tranquil.systems.
+import Testing
+
+@testable import Map
+
+struct StageTests {
+
+ @Test func testStageTypesGrouping() async throws {
+ #expect(StageType.types.count == 4)
+ #expect(StageType.types.contains(.general))
+ #expect(StageType.types.contains(.practice))
+ #expect(StageType.types.contains(.data))
+ #expect(StageType.types.contains(.knowledge))
+
+ #expect(StageType.characteristics.count == 3)
+ #expect(StageType.characteristics.contains(.ubiquity))
+ #expect(StageType.characteristics.contains(.certainty))
+ #expect(StageType.characteristics.contains(.publicationTypes))
+
+ #expect(StageType.properties.count == 12)
+ #expect(StageType.properties.contains(.market))
+ #expect(StageType.properties.contains(.efficiency))
+
+ #expect(StageType.custom.count == 1)
+ #expect(StageType.custom.contains(.behavior))
+ }
+
+ @Test func testStageTypeIdentifiable() async throws {
+ #expect(StageType.general.id == "general")
+ #expect(StageType.practice.id == "practice")
+ #expect(StageType.behavior.id == "behavior")
+ }
+
+ @Test func testStageCreationGeneral() async throws {
+ let stage = Stage.stages(.general)
+ #expect(stage.i == "Genesis")
+ #expect(stage.ii == "Custom")
+ #expect(stage.iii == "Product (+rental)")
+ #expect(stage.iv == "Commodity (+utility)")
+ }
+
+ @Test func testStageCreationPractice() async throws {
+ let stage = Stage.stages(.practice)
+ #expect(stage.i == "Novel")
+ #expect(stage.ii == "Emerging")
+ #expect(stage.iii == "Good")
+ #expect(stage.iv == "Best")
+ }
+
+ @Test func testStageCreationData() async throws {
+ let stage = Stage.stages(.data)
+ #expect(stage.i == "Unmodelled")
+ #expect(stage.ii == "Divergent")
+ #expect(stage.iii == "Convergent")
+ #expect(stage.iv == "Modelled")
+ }
+
+ @Test func testStageCreationKnowledge() async throws {
+ let stage = Stage.stages(.knowledge)
+ #expect(stage.i == "Concept")
+ #expect(stage.ii == "Hypothesis")
+ #expect(stage.iii == "Theory")
+ #expect(stage.iv == "Accepted")
+ }
+
+ @Test func testStageCreationBehavior() async throws {
+ let stage = Stage.stages(.behavior)
+ #expect(stage.i == "Uncertain when to use")
+ #expect(stage.ii == "Learning when to use")
+ #expect(stage.iii == "Learning through use")
+ #expect(stage.iv == "Known / common usage")
+ }
+
+ @Test func testStageTitleGeneral() async throws {
+ let title = Stage.title(.general)
+ #expect(title == "Activities")
+ }
+
+ @Test func testStageTitlePractice() async throws {
+ let title = Stage.title(.practice)
+ #expect(title == "Practice")
+ }
+
+ @Test func testStageTitleBehavior() async throws {
+ let title = Stage.title(.behavior)
+ #expect(title == "Behavior")
+ }
+
+ @Test func testAllStageTypesHaveTitles() async throws {
+ for stageType in StageType.allCases {
+ let title = Stage.title(stageType)
+ #expect(!title.isEmpty)
+ }
+ }
+
+ @Test func testAllStageTypesHaveStages() async throws {
+ for stageType in StageType.allCases {
+ let stage = Stage.stages(stageType)
+ #expect(!stage.i.isEmpty)
+ #expect(!stage.ii.isEmpty)
+ #expect(!stage.iii.isEmpty)
+ #expect(!stage.iv.isEmpty)
+ }
+ }
+
+}