public void UnregisteringCommandWithNullThrows() { Assert.Throws<ArgumentNullException>(() => { var compositeCommand = new CompositeCommand(); compositeCommand.UnregisterCommand(null); }); }
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); }