Ejemplo n.º 1
0
        private static IEnumerable <string> CreateTestKeyStrings(KeyNotation keyNotation)
        {
            const int    notesCount = 12;
            const string hashMark   = "#";

            for (var i = 0; i < notesCount; i++)
            {
                yield return(hashMark + new Key((Note)i, Tone.Moll).ToString(keyNotation).ToLower());

                yield return(hashMark + new Key((Note)i, Tone.Dur).ToString(keyNotation).ToLower());
            }
        }
Ejemplo n.º 2
0
        public void TestGetKeyHashEntry(KeyNotation keyNotation)
        {
            var testKeyStrings = CreateTestKeyStrings(keyNotation);

            foreach (var keyString in testKeyStrings)
            {
                var keyEntry = HashTag.Parser.First(keyString);

                var keyHashTag = keyEntry.HashTag as KeyHashTag;
                Assert.NotNull(keyHashTag, "Not Founded key in \"{0}\"", keyString);

                var expectedKeyString = "#" + keyHashTag.Key.ToString(keyNotation);

                Assert.AreEqual(expectedKeyString, keyString);
            }
        }
Ejemplo n.º 3
0
 public KeyHashTag(Key key, string metaValue, KeyNotation notation = KeyNotation.Default)
     : base(key.ToString(notation), metaValue)
 {
     Key      = key;
     Notation = notation;
 }
Ejemplo n.º 4
0
 public KeyHashTag(Key key, KeyNotation notation = KeyNotation.Default) : this(key, string.Empty, notation)
 {
 }