コード例 #1
0
        public void SelectDashboard_WhenCalled_SelectsFirstWindow()
        {
            //Arrange
            var vm = new MainViewModel {EventAggregator = CreateEventAggregator()};
            var window1 = Mock.Create<ITopLevelWindow>(Behavior.Loose);
            var window2 = Mock.Create<ITopLevelWindow>(Behavior.Loose);
            var window3 = Mock.Create<ITopLevelWindow>(Behavior.Loose);
            vm.Windows.Add(window1);
            vm.Windows.Add(window2);
            vm.Windows.Add(window3);
            vm.SelectedWindow = window2;

            //Act
            vm.SelectDashboard();

            //Assert
            Assert.AreSame(window1, vm.SelectedWindow);
        }