public void RelayCommand_CanExecute()
        {
            var canExecute = true;
            var rc = new RelayCommand(_ => { }, (o) => { return canExecute; });

            Assert.That(rc.CanExecute(canExecute), Is.EqualTo(true));
            canExecute = false;
            Assert.That(rc.CanExecute(canExecute), Is.EqualTo(false));
        }
Beispiel #2
0
        public void TestMainWindow()
        {
            var win = new MainWindow();
            Assert.That(win, Is.Not.Null);

            var rc = new RelayCommand(_ => { });
            rc.CanExecuteChanged += rc_CanExecuteChanged;
            rc.CanExecuteChanged -= rc_CanExecuteChanged;
        }