// 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.customStages.count >= 0) } @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") } }