Exemplo n.º 1
0
        public void ProgressAfterSetPositionMovesToNextBeat(int adjustment, int expectedNextPosition, int expectedLastPosition)
        {
            var dummySample = new Sample("=");
            var expectedSample = new Sample("=");
            var score = new Score();

            score.Progress(); // position will now be eight
            score.SetPosition(adjustment);
            score.AddSample(dummySample);
            score.Progress();
            score.AddSample(expectedSample);
            score.Progress();
            score.AddSample(expectedSample);

            Assert.That(score.Samples[expectedNextPosition].Contains(expectedSample));
            Assert.That(score.Samples[expectedLastPosition].Contains(expectedSample));
        }
Exemplo n.º 2
0
        public void SamplesAreAddedEightFramesApartAfterProgression()
        {
            var firstSample = new Sample("*");
            var secondSample = new Sample("=");
            var score = new Score();

            score.AddSample(firstSample);
            score.Progress();
            score.AddSample(secondSample);

            Assert.That(score.Samples[0].Contains(firstSample));
            Assert.That(score.Samples[8].Contains(secondSample));
        }
Exemplo n.º 3
0
        public void SetPositionAllowsSamplesToBeAddedBeforeAndAfterTheBeat(int adjustment)
        {
            var sample = new Sample("*");
            var score = new Score();

            score.Progress(); // position will now be eight
            score.SetPosition(adjustment);
            score.AddSample(sample);

            const int initialPosition = 8;
            Assert.That(score.Samples[initialPosition + adjustment].Contains(sample));
        }