Reformatting and reimperilment escape codes

This commit is contained in:
Stone_Red
2023-09-27 17:17:28 +02:00
parent 79df5c9b97
commit ce3715c1b5
9 changed files with 591 additions and 543 deletions
+1 -2
View File
@@ -38,7 +38,6 @@ public class CodeFlowTests
[TestMethod]
public void CalculationsTest()
{
Assert.Inconclusive();
YesNtAssert.IsLineEqual("10 * 10 !calc", 20.ToString());
YesNtAssert.IsLineEqual("10 * 10 !calc", 100.ToString());
}
}
+22
View File
@@ -60,4 +60,26 @@ internal static class YesNtAssert
Assert.AreEqual(expected, debugEventArgs.CurrentLine);
}
public static void IsLineNotEqual(string line, string expected, int timeout = 1000)
{
AutoResetEvent onDone = new AutoResetEvent(false);
List<string> lines = new List<string>()
{
line
};
DebugEventArgs debugEventArgs = new DebugEventArgs();
yesNtInterpreter.OnLineExecuted += (er) =>
{
debugEventArgs = er ?? debugEventArgs;
_ = onDone.Set();
};
yesNtInterpreter.Execute(lines, true);
_ = onDone.WaitOne(TimeSpan.FromMilliseconds(timeout));
Assert.AreNotEqual(expected, debugEventArgs.CurrentLine);
}
}