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); }
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); }
//[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); }