Exemplo n.º 1
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: private void checkLogTimeZone(int hoursShift, String timeZoneSuffix) throws Exception
        private void CheckLogTimeZone(int hoursShift, string timeZoneSuffix)
        {
            TimeZone.Default = TimeZone.getTimeZone(ZoneOffset.ofHours(hoursShift));
            Config      timeZoneConfig = Config.defaults(GraphDatabaseSettings.db_timezone, LogTimeZone.SYSTEM.name());
            SecurityLog securityLog    = new SecurityLog(timeZoneConfig, FileSystemRule.get(), ThreadStart.run);

            securityLog.Info("line 1");

            FileSystemAbstraction fs = FileSystemRule.get();
            File activeLogFile       = timeZoneConfig.Get(SecuritySettings.security_log_filename);

            string[] activeLines = ReadLogFile(fs, activeLogFile);
            assertThat(activeLines, array(containsString(timeZoneSuffix)));
            FileSystemRule.clear();
        }