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()); } }
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); } }
public KeyHashTag(Key key, string metaValue, KeyNotation notation = KeyNotation.Default) : base(key.ToString(notation), metaValue) { Key = key; Notation = notation; }
public KeyHashTag(Key key, KeyNotation notation = KeyNotation.Default) : this(key, string.Empty, notation) { }