示例#1
0
        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!");
        }
示例#2
0
        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);
        }
示例#3
0
        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!");
        }