public void CreateDataSetWithNullNameFails() { RuleMSX rmsx = new RuleMSX(); string newDataSetName = null; Assert.Throws <ArgumentException>(() => rmsx.CreateDataSet(newDataSetName)); }
public void DataSetGetNameShouldReturnName() { RuleMSX rmsx = new RuleMSX(); string newDataSetName = "NewDataSet"; DataSet ds = rmsx.CreateDataSet(newDataSetName); Assert.That(ds.GetName(), Is.EqualTo(newDataSetName)); }
public void CreateDataSetReturnsNewDataSet() { RuleMSX rmsx = new RuleMSX(); string newDataSetName = "NewDataSet"; DataSet dataSet = rmsx.CreateDataSet(newDataSetName); Assert.That(dataSet.GetName(), Is.EqualTo(newDataSetName)); }
public void DataSetDataPointAddReturnsNewDataPoint() { RuleMSX rmsx = new RuleMSX(); string newDataSetName = "NewDataSet"; string newDataPointName = "NewDataPointName"; DataSet ds = rmsx.CreateDataSet(newDataSetName); DataPoint dpo = ds.AddDataPoint(newDataPointName); Assert.That(dpo.GetName(), Is.EqualTo(newDataPointName)); }
public void GetDataSetWithIncorrectNameReturnsNull() { RuleMSX rmsx = new RuleMSX(); string newDataSetName = "NewDataSet"; rmsx.CreateDataSet(newDataSetName); DataSet ds = rmsx.GetDataSet("SomeOtherName"); Assert.IsNull(ds); }
public void GetDataSetByNameReturnsCorrectDataSet() { RuleMSX rmsx = new RuleMSX(); string newDataSetName = "NewDataSet"; rmsx.CreateDataSet(newDataSetName); DataSet ds = rmsx.GetDataSet(newDataSetName); Assert.That(ds.GetName(), Is.EqualTo(newDataSetName)); }
public void GetDataSetsReturnsDataSetCollection() { RuleMSX rmsx = new RuleMSX(); string newDataSetName = "NewDataSet"; rmsx.CreateDataSet(newDataSetName); List <DataSet> dsl = rmsx.GetDataSets(); DataSet ds = dsl[0]; Assert.That(ds.GetName(), Is.EqualTo(newDataSetName)); }
public void SetDataPointSourceAtDataPointCreateCheckSource() { RuleMSX rmsx = new RuleMSX(); string newDataSetName = "NewDataSet"; string newDataPointName = "NewDataPointName"; string testDataPointValue = "TestDataPointValue"; DataSet ds = rmsx.CreateDataSet(newDataSetName); DataPointSource srci = new TestDataPointSource(testDataPointValue); DataPoint dpo = ds.AddDataPoint(newDataPointName, srci); DataPointSource srco = dpo.GetSource(); Assert.That(srco.GetValue().ToString(), Is.EqualTo(testDataPointValue)); }
public void GetDataPointsReturnsCorrectDictOfPoints() { RuleMSX rmsx = new RuleMSX(); string newDataSetName = "NewDataSet"; string newDataPointName = "NewDataPointName"; DataSet ds = rmsx.CreateDataSet(newDataSetName); DataPoint dpi = ds.AddDataPoint(newDataPointName); Dictionary <string, DataPoint> dpd = ds.GetDataPoints(); DataPoint dpo; dpd.TryGetValue(newDataPointName, out dpo); Assert.That(dpo.GetName(), Is.EqualTo(newDataPointName)); }
public void DataPointSourceSetStaleNoError() { // Call to SetStale() on DataPointSource should return no error RuleMSX rmsx = new RuleMSX(); string newDataSetName = "NewDataSet"; string newDataPointName = "NewDataPointName"; string testDataPointValue = "TestDataPointValue"; DataSet ds = rmsx.CreateDataSet(newDataSetName); DataPoint dpo = ds.AddDataPoint(newDataPointName); DataPointSource srci = new TestDataPointSource(testDataPointValue); dpo.SetDataPointSource(srci); Assert.DoesNotThrow(() => srci.SetStale()); }
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)); }