aboutsummaryrefslogtreecommitdiff
path: root/MapTests/StageTests.swift
blob: 97502a85afff57db980954981407d873ea91adc3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
// 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")
  }


}