public void TestMethod5() { ScanService service = new ScanService(); string err; bool result = service.Init(out err); if (!result) { Debug.WriteLine(err); Assert.Fail("初始化失败"); } Action <string, string> action = (l, k) => { Debug.WriteLine(l); Debug.WriteLine(k); }; service.StartEngine(action); while (true) { Debug.WriteLine("running..."); Thread.Sleep(3000); } }