public void ReadLogFileTest() { if (!TestHelper.GetDlcPath(out string dlcPath)) { return; } var ope = new UoeDatabaseOperator(dlcPath); var lgPAth = Path.Combine(TestFolder, "ReadLogFileTest.lg"); File.WriteAllText(lgPAth, @" Tue Jan 1 15:28:10 2019 [2019/01/01@14:46:51.345+0100] P-10860 T-17952 I BROKER 0: (333) Multi-user session begin. [2019/01/01@14:46:51.345+0100] P-10860 T-15580 I BROKER 0: (4393) This server is licenced for local logins only. [2019/01/01@14:46:51.345+0100] P-10860 T-7584 I BROKER 0: (4261) Host Name (-H): hostname [2019/01/01@14:46:51.349+0100] P-10860 T-7584 I BROKER 0: (4262) Service Name (-S): 1 "); ope.ReadStartingParametersFromLogFile(lgPAth, out string hostName, out string serviceName); Assert.IsNotNull(hostName); Assert.IsNotNull(serviceName); Assert.AreEqual(@"localhost", hostName); Assert.AreEqual(@"1", serviceName); File.WriteAllText(lgPAth, @" Tue Jan 1 15:28:10 2019 [2019/01/01@14:46:51.345+0100] P-10860 T-17952 I BROKER 0: (333) Multi-user session begin. [2019/01/01@14:46:51.345+0100] P-10860 T-7584 I BROKER 0: (4261) Host Name (-H): hostname [2019/01/01@14:46:51.349+0100] P-10860 T-7584 I BROKER 0: (4262) Service Name (-S): 999 "); ope.ReadStartingParametersFromLogFile(lgPAth, out hostName, out serviceName); Assert.IsNotNull(hostName); Assert.IsNotNull(serviceName); Assert.AreEqual(@"hostname", hostName); Assert.AreEqual(@"999", serviceName); File.WriteAllText(lgPAth, @" Tue Jan 1 15:28:10 2019 [2019/01/01@14:46:51.345+0100] P-10860 T-17952 I BROKER 0: (333) Multi-user session begin. [2019/01/01@14:46:51.345+0100] P-10860 T-7584 I BROKER 0: (4261) Host Name (-H): hostname [2019/01/01@14:46:51.349+0100] P-10860 T-7584 I BROKER 0: (4262) Service Name (-S): 0 "); ope.ReadStartingParametersFromLogFile(lgPAth, out hostName, out serviceName); Assert.AreEqual(null, hostName); Assert.AreEqual(null, serviceName); File.WriteAllText(lgPAth, @" Tue Jan 1 15:28:10 2019 [2019/01/01@14:46:51.345+0100] P-10860 T-17952 I BROKER 0: (333) Multi-user session begin. [2019/01/01@14:46:51.345+0100] P-10860 T-7584 I BROKER 0: (4261) Host Name (-H): hostname [2019/01/01@14:46:51.349+0100] P-10860 T-7584 I BROKER 0: (4262) Service Name (-S): 0 [2019/01/01@14:46:51.349+0100] P-10999 T-7584 I SRV 1: (5646) Started on port 3000 using TCP IPV4 address 127.0.0.1, pid 17372. [2019/01/01@14:46:51.349+0100] P-11111 T-6060 I SQLSRV2 1: (-----) SQL Server 11.7.04 started, configuration: ""db.virtualconfig"" "); var pids = ope.GetPidsFromLogFile(lgPAth).ToList(); Assert.AreEqual(11111, pids[0]); Assert.AreEqual(10999, pids[1]); Assert.AreEqual(10860, pids[2]); }