예제 #1
0
 public void AddWrongTypeSampleToTrack()
 {
     Track t = new Track(8, "guitar", 0);
     Sample s = new Sample("./GuitarG.wav", "guitarChord", "banjo");
     t.AddSample(3, s);
     Assert.AreNotEqual(s, t.samples[3]);
 }
예제 #2
0
 public void CompareTracksDifferentLengths()
 {
     Track t1 = new Track(8, "guitar", 0);
     Track t2 = new Track(10, "guitar", 4);
     Sample s = new Sample("./GuitarG.wav", "guitarChord", "guitar");
     t1.AddSample(3, s);
     t2.AddSample(3, s);
     Assert.IsFalse(CompareTracks(t1, t2));
 }
예제 #3
0
        public void CompareTracksDifferentTypes()
        {
            Track t1 = new Track(8, "guitar", 0);
            Track t2 = new Track(8, "drums", 4);
            Sample s = new Sample("./GuitarG.wav", "guitarChord", "guitar");

            t1.AddSample(3, s);
            //Sample won't be added as it is a different type
            t2.AddSample(5, s);
            Assert.IsFalse(CompareTracks(t1, t2));
        }
예제 #4
0
 public void SwapSample()
 {
     Track t1 = new Track(8, "guitar", 0);
     Sample s1 = new Sample("./GuitarG.wav", "guitarChord", "guitar");
     Sample s2 = new Sample("./GuitarD.wav", "guitarD", "guitar");
     t1.AddSample(5, s1);
     t1.AddSample(2, s2);
     t1.SwapSamples(5, 2);
     Assert.AreEqual(s1, t1.samples[2]);
 }
예제 #5
0
 public void RemoveSample()
 {
     Track t1 = new Track(8, "guitar", 0);
     Sample s1 = new Sample("./GuitarG.wav", "guitarChord", "guitar");
     Sample s2 = new Sample("./GuitarD.wav", "guitarD", "guitar");
     t1.AddSample(5, s1);
     t1.RemoveSample(5);
     Assert.AreNotEqual(s1, t1.samples[5]);
 }
예제 #6
0
 public void MoveSample()
 {
     Track t1 = new Track(8, "guitar", 0);
     Sample s = new Sample("./GuitarG.wav", "guitarChord", "guitar");
     t1.AddSample(5, s);
     t1.MoveSample(5, 2);
     Assert.AreEqual(s, t1.samples[2]);
 }