1
exercism fetch csharp scale-generator

ScaleGeneratorTest.cs

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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
using Xunit;

public class ScaleGeneratorTest
{
    [Fact]
    public void Major_scale()
    {
        var major = ScaleGenerator.Pitches("C", "MMmMMMm");
        var expected = new[] {"C", "D", "E", "F", "G", "A", "B"};
        Assert.Equal(expected, major);
    }

    [Fact(Skip = "Remove to run test")]
    public void Another_major_scale()
    {
        var major = ScaleGenerator.Pitches("G", "MMmMMMm");
        var expected = new[] {"G", "A", "B", "C", "D", "E", "F#"};
        Assert.Equal(expected, major);
    }

    [Fact(Skip = "Remove to run test")]
    public void Minor_scale()
    {
        var minor = ScaleGenerator.Pitches("f#", "MmMMmMM");
        var expected = new[] {"F#", "G#", "A", "B", "C#", "D", "E"};
        Assert.Equal(expected, minor);
    }

    [Fact(Skip = "Remove to run test")]
    public void Another_minor_scale()
    {
        var minor = ScaleGenerator.Pitches("bb", "MmMMmMM");
        var expected = new[] {"Bb", "C", "Db", "Eb", "F", "Gb", "Ab"};
        Assert.Equal(expected, minor);
    }

    [Fact(Skip = "Remove to run test")]
    public void Dorian_mode()
    {
        var dorian = ScaleGenerator.Pitches("d", "MmMMMmM");
        var expected = new[] {"D", "E", "F", "G", "A", "B", "C"};
        Assert.Equal(expected, dorian);
    }

    [Fact(Skip = "Remove to run test")]
    public void Mixolydian_mode()
    {
        var mixolydian = ScaleGenerator.Pitches("Eb", "MMmMMmM");
        var expected = new[] {"Eb", "F", "G", "Ab", "Bb", "C", "Db"};
        Assert.Equal(expected, mixolydian);
    }

    [Fact(Skip = "Remove to run test")]
    public void Lydian_mode()
    {
        var lydian = ScaleGenerator.Pitches("a", "MMMmMMm");
        var expected = new[] {"A", "B", "C#", "D#", "E", "F#", "G#"};
        Assert.Equal(expected, lydian);
    }

    [Fact(Skip = "Remove to run test")]
    public void Phrygian_mode()
    {
        var phrygian = ScaleGenerator.Pitches("e", "mMMMmMM");
        var expected = new[] {"E", "F", "G", "A", "B", "C", "D"};
        Assert.Equal(expected, phrygian);
    }

    [Fact(Skip = "Remove to run test")]
    public void Locrian_mode()
    {
        var locrian = ScaleGenerator.Pitches("g", "mMMmMMM");
        var expected = new[] {"G", "Ab", "Bb", "C", "Db", "Eb", "F"};
        Assert.Equal(expected, locrian);
    }

    [Fact(Skip = "Remove to run test")]
    public void Harmonic_minor()
    {
        var harmonicMinor = ScaleGenerator.Pitches("d", "MmMMmAm");
        var expected = new[] {"D", "E", "F", "G", "A", "Bb", "Db"};
        Assert.Equal(expected, harmonicMinor);
    }

    [Fact(Skip = "Remove to run test")]
    public void Octatonic()
    {
        var octatonic = ScaleGenerator.Pitches("C", "MmMmMmMm");
        var expected = new[] {"C", "D", "D#", "F", "F#", "G#", "A", "B"};
        Assert.Equal(expected, octatonic);
    }

    [Fact(Skip = "Remove to run test")]
    public void Hexatonic()
    {
        var hexatonic = ScaleGenerator.Pitches("Db", "MMMMMM");
        var expected = new[] {"Db", "Eb", "F", "G", "A", "B"};
        Assert.Equal(expected, hexatonic);
    }

    [Fact(Skip = "Remove to run test")]
    public void Pentatonic()
    {
        var pentatonic = ScaleGenerator.Pitches("A", "MMAMA");
        var expected = new[] {"A", "B", "C#", "E", "F#"};
        Assert.Equal(expected, pentatonic);
    }

    [Fact(Skip = "Remove to run test")]
    public void Enigmatic()
    {
        var enigmatic = ScaleGenerator.Pitches("G", "mAMMMmm");
        var expected = new[] {"G", "G#", "B", "C#", "D#", "F", "F#"};
        Assert.Equal(expected, enigmatic);
    }
}