Example #1
0
        public void LocalVariableTest()
        {
            Dictionary <string, string> dictionary = new Dictionary <string, string>();
            LocalVariable localVariableFirst       = new LocalVariable(new List <string> {
                "$x", "777"
            }, dictionary);
            LocalVariable localVariableSecond = new LocalVariable(new List <string> {
                "$y", "666"
            }, dictionary);

            localVariableFirst.Run();

            Assert.AreEqual("$x", localVariableFirst.Name);
            Assert.AreEqual("777", localVariableFirst.Input[1]);
            Assert.AreEqual("777", localVariableFirst.Output[0]);
            dictionary.TryGetValue("$x", out string valueFirst);
            Assert.AreEqual("777", valueFirst);

            localVariableSecond.Run();

            Assert.AreEqual("$y", localVariableSecond.Name);
            Assert.AreEqual("666", localVariableSecond.Input[1]);
            Assert.AreEqual("666", localVariableSecond.Output[0]);
            dictionary.TryGetValue("$y", out string valueSecond);
            Assert.AreEqual("666", valueSecond);
        }