public void GenerateNewCompositionFrom22nd176thAnd1stMeasures()
        {
            var musicDice   = new MusicalDice(sampleCompositionFilePath);
            var composition = new StringBuilder();

            var measure22  = 22;
            var measure176 = 176;
            var measure1   = 1;

            var firstMeasure  = 1;
            var secondMeasure = 2;
            var thirdMeasure  = 3;

            var beatsForMeasure22      = musicDice.RetrieveBeatsForMeasure(measure22);
            var firstMeasureBeatOffset = musicDice.GetBeatOffsetForMeasures(measure22, firstMeasure);
            var newFirstMeasure        = musicDice.GetAdjustedBeatsForNewMeasure(beatsForMeasure22, firstMeasureBeatOffset);

            composition.Append(newFirstMeasure).Append("\n");

            var beatsForMeasure176      = musicDice.RetrieveBeatsForMeasure(measure176);
            var secondMeasureBeatOffset = musicDice.GetBeatOffsetForMeasures(measure176, secondMeasure);
            var newSecondMeasure        = musicDice.GetAdjustedBeatsForNewMeasure(beatsForMeasure176, secondMeasureBeatOffset);

            composition.Append(newSecondMeasure).Append("\n");

            var beatsForMeasure1       = musicDice.RetrieveBeatsForMeasure(measure1);
            var thirdMeasureBeatOffset = musicDice.GetBeatOffsetForMeasures(measure1, thirdMeasure);
            var newThirdMeasure        = musicDice.GetAdjustedBeatsForNewMeasure(beatsForMeasure1, thirdMeasureBeatOffset);

            composition.Append(newThirdMeasure).Append("\n");

            var newComposition = composition.ToString().Trim();

            Approvals.Verify(newComposition);
        }
        public void Measure176ToBecomeMeasure6()
        {
            var musicDice      = new MusicalDice(sampleCompositionFilePath);
            var currentMeasure = 176;
            var newMeasure     = 6;

            var beatOffset = musicDice.GetBeatOffsetForMeasures(currentMeasure, newMeasure);

            var expected = -510;

            Assert.AreEqual(beatOffset, expected);
        }
        public void Measure22ToBecomeMeasure1()
        {
            var musicDice      = new MusicalDice(sampleCompositionFilePath);
            var currentMeasure = 22;
            var newMeasure     = 1;

            var beatOffset = musicDice.GetBeatOffsetForMeasures(currentMeasure, newMeasure);

            var expected = -63;

            Assert.AreEqual(expected, beatOffset);
        }
        public void Measure8BeatsCalculatedToBeMeasure13Beats()
        {
            var musicDice      = new MusicalDice(sampleCompositionFilePath);
            var currentMeasure = 8;
            var newMeasure     = 13;

            var currentMeasureBeats = musicDice.RetrieveBeatsForMeasure(currentMeasure);
            var beatOffset          = musicDice.GetBeatOffsetForMeasures(currentMeasure, newMeasure);
            var newMeasureBeats     = musicDice.GetAdjustedBeatsForNewMeasure(currentMeasureBeats, beatOffset);

            Approvals.Verify(newMeasureBeats);
        }