public void DocumentVM_PlayCommand_RunsPlayerPlayMetohd() { FakeDocumentViewModel document = new FakeDocumentViewModel(); document.PlayCommand.Execute(null); var success = (document.GetPlayer() as StubbDocumentPlayer).PlayWasRun; Assert.IsTrue(success, "The PlayWasRun should have been true."); }
public void MainWindowVM_DeleteChord_RunsDocumentDeleteChordMethod() { MainWindowModel model = new MainWindowModel(); var doc = new FakeDocumentViewModel(model); model.Documents.Add(doc); model.DeleteChord.Execute(null); Assert.IsTrue(doc.DeleteSelectedChordWasRun, "The method on DocumentVM should have run."); }
public void DocumentVM_CM_DeleteLine_RemovesChordLine() { FakeDocumentViewModel document = new FakeDocumentViewModel(); var line = new ChordLine(); document.ChordLines.Add(line); document.SelectedChordLine = line; document.CM_DeleteLine.Execute(null); Assert.AreEqual(document.ChordLines.Count, 0, "There should be 0 lines now."); }
public void DocumentVM_DeleteSelectedChord_DeletesTheChord() { FakeDocumentViewModel document = new FakeDocumentViewModel(); var line = new ChordLine(); var chord = new Chord(); line.Chords.Add(chord); document.ChordLines.Add(line); document.SelectedChord = chord; document.DeleteSelectedChord(); Assert.IsNull(document.SelectedChord, "SelectedChord should be null."); Assert.AreEqual(line.Chords.Count, 0, "There should be 0 chords in the line now."); }
public void DocumentVM_UpdateProgress_SendsStopIfFinished() { PlayerUpdate update = new PlayerUpdate { Beat = 4, Measure = 5, BeatCompleteness = 0 }; FakeDocumentViewModel document = new FakeDocumentViewModel(); document.ChordLines.Add(new ChordLine()); document.UpdateProgress(update); var stopDidRun = (document.GetPlayer() as StubbDocumentPlayer).StopWasRun; Assert.IsTrue(stopDidRun, "Stop should have been run, since the player was done playing."); }