diff ServerMonitor/Objects/Checks/FileCheck.cs @ 9:7127d5b5ac75

Code cleanup and comments
author Brad Greco <brad@bgreco.net>
date Mon, 08 Apr 2019 21:29:54 -0400
parents 3142e52cbe69
children a36cc5c123f4
line wrap: on
line diff
--- a/ServerMonitor/Objects/Checks/FileCheck.cs	Sat Mar 09 20:14:03 2019 -0500
+++ b/ServerMonitor/Objects/Checks/FileCheck.cs	Mon Apr 08 21:29:54 2019 -0400
@@ -75,6 +75,7 @@
                 }
                 if (CheckDateModified)
                 {
+                    // TODO use the server time instead
                     string dateString = tokens[5] + " " + tokens[6];
                     if (DateTime.TryParse(dateString, out DateTime modified))
                     {
@@ -104,8 +105,8 @@
                 message += "File is required." + Environment.NewLine;
             if (!CheckFileSize && !CheckDateModified)
                 message += "At least one check must be enabled." + Environment.NewLine;
-            if (CheckFileSize && FileSize <= 0)
-                message += "File size must be greater than 0." + Environment.NewLine;
+            if (CheckFileSize && FileSize < 0)
+                message += "File size must be at least 0." + Environment.NewLine;
             if (CheckDateModified && DateModified <= 0)
                 message += "Date modified must be greater than 0." + Environment.NewLine;
             return message;