public void CreateRuleSetWithNullNameFails() { RuleMSX rmsx = new RuleMSX(); string newRuleSetName = ""; Assert.Throws <ArgumentException>(() => rmsx.CreateRuleSet(newRuleSetName)); }
public void CreateRuleSetReturnsNewRuleSet() { RuleMSX rmsx = new RuleMSX(); string newRuleSetName = "NewRuleSet"; RuleSet ruleSet = rmsx.CreateRuleSet(newRuleSetName); Assert.That(ruleSet.GetName(), Is.EqualTo(newRuleSetName)); }
public void RuleSetGetNameShouldReturnName() { RuleMSX rmsx = new RuleMSX(); string newRuleSetName = "NewRuleSet"; RuleSet rs = rmsx.CreateRuleSet(newRuleSetName); Assert.That(rs.GetName(), Is.EqualTo(newRuleSetName)); }
public void GetRuleSetWithIncorrectNameReturnsNull() { RuleMSX rmsx = new RuleMSX(); string newRuleSetName = "NewRuleSet"; rmsx.CreateRuleSet(newRuleSetName); RuleSet rs = rmsx.GetRuleSet("SomeOtherName"); Assert.IsNull(rs); }
public void GetRuleSetByNameReturnsCorrectRuleSet() { RuleMSX rmsx = new RuleMSX(); string newRuleSetName = "NewRuleSet"; rmsx.CreateRuleSet(newRuleSetName); RuleSet rs = rmsx.GetRuleSet(newRuleSetName); Assert.That(rs.GetName(), Is.EqualTo(newRuleSetName)); }
public void GetRuleSetsReturnsRuleSetCollection() { RuleMSX rmsx = new RuleMSX(); string newRuleSetName = "NewRuleSet"; rmsx.CreateRuleSet(newRuleSetName); List <RuleSet> rsl = rmsx.GetRuleSets(); RuleSet rs = rsl[0]; Assert.That(rs.GetName(), Is.EqualTo(newRuleSetName)); }
public void GetRulesReturnsCorrectListOfRules() { RuleMSX rmsx = new RuleMSX(); string newRuleSetName = "NewRuleSet"; string newRuleName = "NewRuleName"; RuleSet rs = rmsx.CreateRuleSet(newRuleSetName); Rule ri = rs.AddRule(newRuleName); List <Rule> rl = rs.GetRules(); Rule ro = rl[0]; Assert.That(ro.GetName(), Is.EqualTo(newRuleName)); }
public void RuleMSXStopShouldReturnTrueWithActiveRuleSet() { RuleMSX rmsx = new RuleMSX(); string newRuleSetName = "NewRuleSet"; string newDataSetName = "NewDataSet"; string newRuleName = "Rule1"; RuleSet rs = rmsx.CreateRuleSet(newRuleSetName); rs.AddRule(newRuleName); DataSet ds = rmsx.CreateDataSet(newDataSetName); rs.Execute(ds); Assert.That(rmsx.Stop(), Is.EqualTo(true)); }
public void RuleMSXStopShouldReturnTrueWithUnexecutedRuleSet() { RuleMSX rmsx = new RuleMSX(); string newRuleSetName = "NewRuleSet"; string newDataSetName = "NewDataSet"; string newRuleName = "Rule1"; RuleSet rs = rmsx.CreateRuleSet(newRuleSetName); rs.AddRule(newRuleName); DataSet ds = rmsx.CreateDataSet(newDataSetName); // We are deliberately not executing the ruleset... //rs.Execute(ds); Assert.That(rmsx.Stop(), Is.EqualTo(true)); }