public void Given_An_ImageList_When_Changing_Order_Should_Set_SortDirection_ToReversed() { // Arrange var viewModel = new PictureViewerViewModel(); viewModel.ImageList = new ObservableCollection <string> { "Entry_1" }; // Act viewModel.ChangeOrderCommand.Execute(SortDirection.Reversed); // Assert Assert.AreEqual(viewModel.CurrentListSortDirection, SortDirection.Reversed, "SortDirection was not changed!"); }
public RemoterMainView() { InitializeComponent(); var player = new Player(); //Initialize all view models for all controls DataContext = new MainViewViewModel(DeviceFinderAndNavigator.ViewModel, InfoPanel.ViewModel, player); DeviceFinderAndNavigator.DataContext = new DeviceControllerViewModel(player); MediaPlayer.InitDataContext(new MediaPlayerViewModel(player)); InfoPanel.DataContext = new ArtistInfoViewModel(player); //Picture viewer data context setup var picViewerViewModel = new PictureViewerViewModel(player); PicViewer.DataContext = picViewerViewModel; PicInfoPanel.DataContext = new PictureInfoViewModel(picViewerViewModel); }
public void Given_An_ImageList_When_Changing_Order_Should_Move_FirstEntry_To_End_Of_List() { // Arrange var viewModel = new PictureViewerViewModel(); viewModel.ImageList = new ObservableCollection <string> { "Entry_1", "Entry_2", "Entry_3", "Entry_4", "Entry_5" }; // Act viewModel.ChangeOrderCommand.Execute(SortDirection.Reversed); // Assert string newLastEntry = viewModel.ImageList.Last(); Assert.AreEqual(newLastEntry, "Entry_1", false, "Collection was not reversed by ViewModelCommand!"); }