Beispiel #1
0
        public void TestParameterizedCanExecuteInvalidParameter()
        {
            var command = new TestParameterizedCommand();

            Assert.That(((ICommand)command).CanExecute(null), Is.False);
            Assert.That(((ICommand)command).CanExecute("happy"), Is.False);
        }
Beispiel #2
0
        public void TestParameterizedExecuteICommand()
        {
            var command = new TestParameterizedCommand();

            Assert.That(command.ExecuteParameter, Is.EqualTo(0));
            ((ICommand)command).Execute(4);
            Assert.That(command.ExecuteParameter, Is.EqualTo(4));
        }
Beispiel #3
0
        public void TestParameterizedCanExecuteChanged()
        {
            var eventRaised = false;
            var command     = new TestParameterizedCommand();

            command.CanExecuteChanged += (o, e) => eventRaised = true;

            command.RaiseCanExecuteChanged();
            Assert.That(eventRaised, Is.True);
        }
Beispiel #4
0
        public void TestParameterizedCanExecute()
        {
            var command = new TestParameterizedCommand();

            Assert.That(command.CanExecute(4), Is.True);
            Assert.That(command.CanExecute(7), Is.False);
            Assert.That(((ICommand)command).CanExecute(4), Is.True);
            Assert.That(((ICommand)command).CanExecute(7), Is.False);
            Assert.That(command.ExecuteParameter, Is.EqualTo(0));
        }
Beispiel #5
0
        public void TestParameterizedInheritance()
        {
            var command = new TestParameterizedCommand();

            Assert.That(command, Is.InstanceOf <ICommand>());
        }