public void DebugItemWarewolfAtomListResult_IsListOldValue_GetDebugItemResult() { //---------------Set up test pack------------------- var env = new Mock <IExecutionEnvironment>(); env.Setup(environment => environment.EvalToExpression(It.IsAny <string>(), It.IsAny <int>())).Returns("[[scalar]]"); var warewolfAtomResult = CommonFunctions.WarewolfEvalResult.NewWarewolfAtomResult(DataStorage.WarewolfAtom.NewDataString("{\"PolicyNo\":\"A0003\",\"DateId\":32,\"SomeVal\":\"Bob\"}")); env.Setup(environment => environment.Eval(It.IsAny <string>(), It.IsAny <int>(), It.IsAny <bool>(), It.IsAny <bool>())).Returns(warewolfAtomResult); var atomList = new WarewolfAtomList <DataStorage.WarewolfAtom>(DataStorage.WarewolfAtom.NewDataString("Home")); var newWarewolfAtomListresult = CommonFunctions.WarewolfEvalResult.NewWarewolfAtomListresult(atomList) as CommonFunctions.WarewolfEvalResult.WarewolfAtomListresult; Assert.IsNotNull(newWarewolfAtomListresult); newWarewolfAtomListresult.Item.AddSomething(DataStorage.WarewolfAtom.NewDataString("KingDom Of The Zulu")); var debugEvalResult = new DebugItemWarewolfAtomListResult(newWarewolfAtomListresult, newWarewolfAtomListresult, "newValue(1)", "Variable", "", "Some right label text", ""); //---------------Assert Precondition---------------- Assert.IsNotNull(debugEvalResult); //---------------Execute Test ---------------------- Assert.AreEqual("", debugEvalResult.LabelText); var debugItemResults = debugEvalResult.GetDebugItemResult(); //---------------Test Result ----------------------- Assert.AreEqual(1, debugItemResults.Count); Assert.AreEqual("KingDom Of The Zulu", debugItemResults[0].Value); }
public void DebugItemWarewolfAtomListResult_GetDebugItemResult() { //---------------Set up test pack------------------- var env = new Mock <IExecutionEnvironment>(); env.Setup(environment => environment.EvalToExpression(It.IsAny <string>(), It.IsAny <int>())).Returns("[[@scalar()]]"); var warewolfAtomResult = CommonFunctions.WarewolfEvalResult.NewWarewolfAtomResult(DataStorage.WarewolfAtom.NewDataString("{\"PolicyNo\":\"A0003\",\"DateId\":32,\"SomeVal\":\"Bob\"}")); env.Setup(environment => environment.Eval(It.IsAny <string>(), It.IsAny <int>(), It.IsAny <bool>(), It.IsAny <bool>())).Returns(warewolfAtomResult); var atomList = new WarewolfAtomList <DataStorage.WarewolfAtom>(DataStorage.WarewolfAtom.NewDataString("Home")); var newWarewolfAtomListresult = CommonFunctions.WarewolfEvalResult.NewWarewolfAtomListresult(atomList) as CommonFunctions.WarewolfEvalResult.WarewolfAtomListresult; var debugEvalResult = new DebugItemWarewolfAtomListResult(newWarewolfAtomListresult, "newValue", "[[@home]]", "a", "b", "b", ""); //---------------Assert Precondition---------------- //---------------Execute Test ---------------------- var debugItemResults = debugEvalResult.GetDebugItemResult(); //---------------Test Result ----------------------- var value = debugItemResults[0].Value; var operato = debugItemResults[0].Operator; Assert.AreEqual("newValue", value); Assert.AreEqual("", debugEvalResult.LabelText); Assert.AreEqual("=", operato); }