Ejemplo n.º 1
0
        public void Test2()
        {
            var s = @"SAY The $animal woke $count times";

            Substitutor.ReplaceVars(ref s, globals);
            Console.WriteLine("Running SubstitutionTests.Test2 :: " + s);
            Assert.Equal("SAY The dog woke 4 times", s);
        }
Ejemplo n.º 2
0
        public void Test1()
        {
            var s = @"SAY The $animal woke and $prep (ate|ate)";

            Substitutor.ReplaceGroups(ref s);
            Substitutor.ReplaceVars(ref s, globals);
            Console.WriteLine("Running SubstitutionTests.Test1 :: " + s);
            Assert.Equal("SAY The dog woke and then ate", s);
        }
Ejemplo n.º 3
0
        //[Fact]
        public void Test4() // FAILS
        {
            var s = @"SAY The $animal woke $count times";

            new ScriptingEngine(globals).Exec("count++;");
            Console.WriteLine("globals=" + globals);
            Substitutor.ReplaceVars(ref s, globals);
            Console.WriteLine("Running SubstitutionTests.Test3 :: " + s);
            Assert.Equal("SAY The dog woke 4 times", s);
        }