public void RuleConfigurationControllerClearRuleConfigurationOnRuleSelectionChangedWithNullRule() { Expect.Call(() => _view.ClearRuleConfiguration()).Repeat.Once(); Mocker.ReplayAll(); RuleConfigurationController controller = new RuleConfigurationController(_view, _provider, _configFactory); _view.RuleTreeView.Raise(x => x.RuleSelectionChanged += null, this, new RuleEventArgs(null)); Mocker.VerifyAll(); }
private void RuleTreeView_RuleSelectionChanged(object sender, RuleEventArgs e) { if (e.SelectedRule != null) { IRuleConfiguration config = _configFactory.GetRuleConfigurationFor(e.SelectedRule.GetType()); _view.DisplayRuleConfiguration(config); CurrentConfiguration = config; } else { _view.ClearRuleConfiguration(); CurrentConfiguration = null; } HasChanges = false; }