public static string Execute(string inputTactSize, string inputStaves) { try { var tactSize = Parser.ToNoteOrDefault(inputTactSize); var tacts = Parser.ToTacts(inputStaves); Optimizator.ExecuteForNote(tactSize); Optimizator.ExecuteForTacts(tacts); var validationResults = Validator.Compare(tactSize, tacts); return(Reporter.ExportToString(validationResults)); } catch (Exception ex) { return(string.Format(Constants.Messages.OutputError, ex.Message)); } }
public void RunNoteOptimizeTests(Note input, Note expectedOptimized) { Optimizator.ExecuteForNote(input); Assert.True(input.Numerator == expectedOptimized.Numerator && input.Denominator == expectedOptimized.Denominator); }