public void ShouldReraiseCanExecuteChangedEvent() { TestableCompositeCommand multiCommand = new TestableCompositeCommand(); TestCommand testCommandOne = new TestCommand() { CanExecuteValue = true }; Assert.IsFalse(multiCommand.CanExecuteChangedRaised); multiCommand.RegisterCommand(testCommandOne); testCommandOne.FireCanExecuteChanged(); Assert.IsTrue(multiCommand.CanExecuteChangedRaised); }
public void UnregisterCommandDisconnectsCanExecuteChangedDelegate() { TestableCompositeCommand multiCommand = new TestableCompositeCommand(); TestCommand testCommandOne = new TestCommand() { CanExecuteValue = true }; multiCommand.RegisterCommand(testCommandOne); multiCommand.UnregisterCommand(testCommandOne); multiCommand.CanExecuteChangedRaised = false; testCommandOne.FireCanExecuteChanged(); Assert.IsFalse(multiCommand.CanExecuteChangedRaised); }