private void AssertException(string mml) { MMLParser parser = new MMLParser(); var parsed = parser.Parse(mml); MusicXMLGenerator g = new MusicXMLGenerator(); g.GenerateFromElements(parsed); }
private void AssertMusicXmlAreEqual(string mml, bool create) { System.Diagnostics.StackFrame callerFrame = new System.Diagnostics.StackFrame(1); System.Reflection.MethodBase callerMethod = callerFrame.GetMethod(); string methodName = callerMethod.Name; MMLParser parser = new MMLParser(); IElement[] parsed = parser.Parse(mml); MusicXMLGenerator g = new MusicXMLGenerator(); var xElement = g.GenerateFromElements(parsed); if (create) { WriteXml(methodName, xElement); } var expected = ReadXml(methodName); Assert.AreEqual(expected, xElement.ToString()); }