Skip to content

Commit

Permalink
Rename QueueViewModel to MainWindowViewModel
Browse files Browse the repository at this point in the history
  • Loading branch information
cwl157 committed Nov 1, 2020
1 parent 76dbbe3 commit fff4f33
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
14 changes: 7 additions & 7 deletions src/MusicPlayer.Tests/QueueViewModelTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public void AddToQueueCommand_Test()
IMusicPlayer mp = new MusicPlayerStub();
IQueueLoader ql = new QueueLoaderStub();
SongCollection collection = new SongCollection(ql);
QueueViewModel vm = new QueueViewModel(mp, collection);
MainWindowViewModel vm = new MainWindowViewModel(mp, collection);

vm.AddToQueueCommand.Execute(null);
Assert.AreEqual(2, vm.SongList.Count);
Expand All @@ -40,7 +40,7 @@ public void ClearQueueCommand_Test()
IMusicPlayer mp = new MusicPlayerStub();
IQueueLoader ql = new QueueLoaderStub();
SongCollection collection = new SongCollection(ql);
QueueViewModel vm = new QueueViewModel(mp, collection);
MainWindowViewModel vm = new MainWindowViewModel(mp, collection);

vm.AddToQueueCommand.Execute(null);
vm.ClearQueueCommand.Execute(null);
Expand All @@ -55,7 +55,7 @@ public void PlayCommand_Test()
IMusicPlayer mp = new MusicPlayerStub();
IQueueLoader ql = new QueueLoaderStub();
SongCollection collection = new SongCollection(ql);
QueueViewModel vm = new QueueViewModel(mp, collection);
MainWindowViewModel vm = new MainWindowViewModel(mp, collection);

vm.AddToQueueCommand.Execute(null);

Expand All @@ -80,7 +80,7 @@ public void PauseCommand_Test()
IMusicPlayer mp = new MusicPlayerStub();
IQueueLoader ql = new QueueLoaderStub();
SongCollection col = new SongCollection(ql);
QueueViewModel vm = new QueueViewModel(mp, col);
MainWindowViewModel vm = new MainWindowViewModel(mp, col);

vm.AddToQueueCommand.Execute(null);

Expand All @@ -99,7 +99,7 @@ public void StopCommand_Test()
IMusicPlayer mp = new MusicPlayerStub();
IQueueLoader ql = new QueueLoaderStub();
SongCollection col = new SongCollection(ql);
QueueViewModel vm = new QueueViewModel(mp, col);
MainWindowViewModel vm = new MainWindowViewModel(mp, col);

vm.AddToQueueCommand.Execute(null);

Expand All @@ -122,7 +122,7 @@ public void FastForwardCommand_Test()
IMusicPlayer mp = new MusicPlayerStub();
IQueueLoader ql = new QueueLoaderStub();
SongCollection col = new SongCollection(ql);
QueueViewModel vm = new QueueViewModel(mp, col);
MainWindowViewModel vm = new MainWindowViewModel(mp, col);

vm.AddToQueueCommand.Execute(null);

Expand All @@ -145,7 +145,7 @@ public void RewindCommand_Test()
IMusicPlayer mp = new MusicPlayerStub();
IQueueLoader ql = new QueueLoaderStub();
SongCollection col = new SongCollection(ql);
QueueViewModel vm = new QueueViewModel(mp, col);
MainWindowViewModel vm = new MainWindowViewModel(mp, col);

vm.AddToQueueCommand.Execute(null);

Expand Down
4 changes: 2 additions & 2 deletions src/MusicPlayer/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ namespace MusicPlayer
/// </summary>
public partial class MainWindow : Window, IMusicPlayer
{
private QueueViewModel _vm;
private MainWindowViewModel _vm;
public MainWindow()
{
InitializeComponent();
Player.LoadedBehavior = MediaState.Manual;
IQueueLoader ql = new FileQueueLoader();
SongCollection collection = new SongCollection(ql);
_vm = new QueueViewModel(this, collection);
_vm = new MainWindowViewModel(this, collection);
DataContext = _vm;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

namespace MusicPlayer.ViewModels
{
public class QueueViewModel : INotifyPropertyChanged
public class MainWindowViewModel : INotifyPropertyChanged
{
private Timer _incrementPlayingProgress;
private Timer _findSongEnd;
Expand All @@ -35,7 +35,7 @@ public class QueueViewModel : INotifyPropertyChanged
public ICommand FastForwardCommand { get; private set; }
public ICommand RewindCommand { get; private set; }

public QueueViewModel(IMusicPlayer m, SongCollection collection)
public MainWindowViewModel(IMusicPlayer m, SongCollection collection)
{
if (DesignerProperties.GetIsInDesignMode(
new System.Windows.DependencyObject())) return;
Expand Down

0 comments on commit fff4f33

Please sign in to comment.