コード例 #1
0
 public void DocumentPlayer_WorkerThread_ReportsToDocument()
 {
     StubbDocumentViewModel document = new StubbDocumentViewModel();
     StubbDocumentPlayer player = new StubbDocumentPlayer(document);
     player.IsPlaying = true;
     player.BeatSpan = TimeSpan.FromSeconds(player.GetBeatDurationAsSeconds(document.TempoInt));
     player.BeatPeriod = TimeSpan.FromSeconds(player.GetBeatDurationAsSeconds(document.TempoInt));
     player.ExecuteDoWork();
     Assert.IsTrue(document.HasBeenUpdated, "Document should have been updated.");
 }
コード例 #2
0
        public void DocumentPlayer_WorkerThread_UpdatesCorrectly()
        {
            DocumentViewModel document = new DocumentViewModel();
            document.ChordLines.Add(new ChordLine());
            document.Tempo = "120";

            StubbDocumentPlayer player = new StubbDocumentPlayer(document);
            player.RunTime = new TimeSpan(0, 0, 0, 1,100);
            player.IsPlaying = true;
            player.BeatSpan = TimeSpan.FromSeconds(player.GetBeatDurationAsSeconds(document.TempoInt));
            player.BeatPeriod = TimeSpan.FromSeconds(player.GetBeatDurationAsSeconds(document.TempoInt));
            player.ExecuteDoWork();
            Assert.AreEqual(1, player.Measure);
            Assert.AreEqual(3, player.Beat);
        }