private static void FTest(ref bool allTests, ref int numTests, World world, string str) { numTests++; string[] fargs = Regex.Match(str, @"\(.*?\)").Value.Replace("(", "").Replace(")", "").Trim().Split(','); string port = fargs[0].Trim(); bool value = Convert.ToInt32(fargs[1].Trim()) == 1; if (value == world.GetPortValue(port)) { Console.ForegroundColor = ConsoleColor.Green; Console.WriteLine("Test port:{0} - OK", port); Console.ForegroundColor = ConsoleColor.White; } else { Console.ForegroundColor = ConsoleColor.Red; Console.WriteLine("Test port:{0} - ERROR", port); Console.ForegroundColor = ConsoleColor.White; allTests = false; } }
private static void FRead(World world, string str) { string port = Regex.Match(str, @"\(.*?\)").Value.Replace("(", "").Replace(")", "").Trim(); Console.WriteLine("{0}={1}", port, world.GetPortValue(port)); }