public void DsfCalculateActivity_UpdateForEachOutputs_GivenNullUpdates_DoNothing() { //------------Setup for test-------------------------- const string expression = "sum([[Numeric(1).num]],[[Numeric(2).num]])"; const string result = "[[res]]"; var act = new DsfDotNetCalculateActivity { Expression = expression, Result = result }; //------------Execute Test--------------------------- act.UpdateForEachOutputs(null); //------------Assert Results------------------------- Assert.AreEqual(expression, act.Expression); }
public void DsfCalculateActivity_UpdateForEachOutputs_GivenOneUpdate_UpdatesExpressionToItem2InTuple() { //------------Setup for test-------------------------- const string expression = "sum([[Numeric(1).num]],[[Numeric(2).num]])"; const string result = "[[res]]"; var act = new DsfDotNetCalculateActivity { Expression = expression, Result = result }; var tuple1 = new Tuple <string, string>("[[res]]", "Test"); //------------Execute Test--------------------------- act.UpdateForEachOutputs(new List <Tuple <string, string> > { tuple1 }); //------------Assert Results------------------------- Assert.AreEqual("Test", act.Result); }
public void DsfCalculateActivity_UpdateForEachOutputs_GivenMoreThanOneUpdates_DoNothing() { //------------Setup for test-------------------------- const string expression = "sum([[Numeric(1).num]],[[Numeric(2).num]])"; const string result = "[[res]]"; var act = new DsfDotNetCalculateActivity { Expression = expression, Result = result }; var tuple1 = new Tuple <string, string>("Test", "Test"); var tuple2 = new Tuple <string, string>("Test2", "Test2"); //------------Execute Test--------------------------- act.UpdateForEachOutputs(new List <Tuple <string, string> > { tuple1, tuple2 }); //------------Assert Results------------------------- Assert.AreEqual(expression, act.Expression); }