1
exercism fetch fsharp scale-generator

ScaleGeneratorTest.fs

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
module ScaleGeneratorTest

open Xunit
open FsUnit.Xunit

open ScaleGenerator

[<Fact>]
let ``Major scale`` () =
    let major = pitches "C" "MMmMMMm"
    let expected = ["C"; "D"; "E"; "F"; "G"; "A"; "B"]
    major |> should equal expected

[<Fact(Skip = "Remove to run test")>]
let ``Another major scale`` () =
    let major = pitches "G" "MMmMMMm"
    let expected = ["G"; "A"; "B"; "C"; "D"; "E"; "F#"]
    major |> should equal expected

[<Fact(Skip = "Remove to run test")>]
let ``Minor scale`` () =
    let minor = pitches "f#" "MmMMmMM"
    let expected = ["F#"; "G#"; "A"; "B"; "C#"; "D"; "E"]
    minor |> should equal expected

[<Fact(Skip = "Remove to run test")>]
let ``Another minor scale`` () =
    let minor = pitches "bb" "MmMMmMM"
    let expected = ["Bb"; "C"; "Db"; "Eb"; "F"; "Gb"; "Ab"]
    minor |> should equal expected
    
[<Fact(Skip = "Remove to run test")>]
let ``Dorian mode`` () =
    let dorian = pitches "d" "MmMMMmM"
    let expected = ["D"; "E"; "F"; "G"; "A"; "B"; "C"]
    dorian |> should equal expected

[<Fact(Skip = "Remove to run test")>]
let ``Mixolydian mode`` () =
    let mixolydian = pitches "Eb" "MMmMMmM"
    let expected = ["Eb"; "F"; "G"; "Ab"; "Bb"; "C"; "Db"]
    mixolydian |> should equal expected

[<Fact(Skip = "Remove to run test")>]
let ``Lydian mode`` () =
    let lydian = pitches "a" "MMMmMMm"
    let expected = ["A"; "B"; "C#"; "D#"; "E"; "F#"; "G#"]
    lydian |> should equal expected

[<Fact(Skip = "Remove to run test")>]
let ``Phrygian mode`` () =
    let phrygian = pitches "e" "mMMMmMM"
    let expected = ["E"; "F"; "G"; "A"; "B"; "C"; "D"]
    phrygian |> should equal expected

[<Fact(Skip = "Remove to run test")>]
let ``Locrian mode`` () =
    let locrian = pitches "g" "mMMmMMM"
    let expected = ["G"; "Ab"; "Bb"; "C"; "Db"; "Eb"; "F"]
    locrian |> should equal expected

[<Fact(Skip = "Remove to run test")>]
let ``Harmonic minor`` () =
    let harmonicMinor = pitches "d" "MmMMmAm"
    let expected = ["D"; "E"; "F"; "G"; "A"; "Bb"; "Db"]
    harmonicMinor |> should equal expected

[<Fact(Skip = "Remove to run test")>]
let ``Octatonic`` () =
    let octatonic = pitches "C" "MmMmMmMm"
    let expected = ["C"; "D"; "D#"; "F"; "F#"; "G#"; "A"; "B"]
    octatonic |> should equal expected

[<Fact(Skip = "Remove to run test")>]
let ``Hexatonic`` () =
    let hexatonic = pitches "Db" "MMMMMM"
    let expected = ["Db"; "Eb"; "F"; "G"; "A"; "B"]
    hexatonic |> should equal expected

[<Fact(Skip = "Remove to run test")>]
let ``Pentatonic`` () =
    let pentatonic = pitches "A" "MMAMA"
    let expected = ["A"; "B"; "C#"; "E"; "F#"]
    pentatonic |> should equal expected

[<Fact(Skip = "Remove to run test")>]
let ``Enigmatic`` () =
    let enigmatic = pitches "G" "mAMMMmm"
    let expected = ["G"; "G#"; "B"; "C#"; "D#"; "F"; "F#"]
    enigmatic |> should equal expected