Esempio n. 1
0
 public void UnregisteringCommandWithNullThrows()
 {
     Assert.Throws<ArgumentNullException>(() =>
     {
         var compositeCommand = new CompositeCommand();
         compositeCommand.UnregisterCommand(null);
     });
 }
Esempio n. 2
0
        public void UnregisterCommandDisconnectsIsActiveChangedDelegate()
        {
            CompositeCommand activeAwareCommand = new CompositeCommand(true);
            MockActiveAwareCommand commandOne = new MockActiveAwareCommand() { IsActive = true, IsValid = true };
            MockActiveAwareCommand commandTwo = new MockActiveAwareCommand() { IsActive = false, IsValid = false };
            activeAwareCommand.RegisterCommand(commandOne);
            activeAwareCommand.RegisterCommand(commandTwo);

            Assert.True(activeAwareCommand.CanExecute(null));

            activeAwareCommand.UnregisterCommand(commandOne);

            Assert.False(activeAwareCommand.CanExecute(null));
        }
 public void UnregisteringCommandWithNullThrows()
 {
     var compositeCommand = new CompositeCommand();
     compositeCommand.UnregisterCommand(null);
 }