commit de13977445a4ad0a8dda2ddaa70c8caf0ebb31bf
Author: A-Konig <alex-nebulae@seznam.cz>
Date:   Sat Jun 12 19:45:18 2021 +0200

    re #9037 Adding a couple of JisParser tests

diff --git a/Server/ServerAppFunctionalTests/ParserTests/JsonParserTesting.cs b/Server/ServerAppFunctionalTests/ParserTests/JsonParserTesting.cs
index 112982d..e46985c 100644
--- a/Server/ServerAppFunctionalTests/ParserTests/JsonParserTesting.cs
+++ b/Server/ServerAppFunctionalTests/ParserTests/JsonParserTesting.cs
@@ -429,6 +429,38 @@ namespace ServerAppFunctionalTests.ParserTests
         #endregion
 
         #region GetPredictionForTime
+
+        [TestMethod]
+        public void GetPredictionForTimeOne()
+        {
+            string data = "";
+
+            Mock<IDataDownloader> dl = new Mock<IDataDownloader>();
+            dl.Setup(m => m.DownloadWeatherPrediction()).Returns(data);
+
+            Mock<IDataLoader> l = new Mock<IDataLoader>();
+
+            JsonParser target = new JsonParser(dl.Object, l.Object);
+
+            List<WeatherInfo> pred = new List<WeatherInfo>();
+            pred.Add(new WeatherInfo(new DateTime(2000, 1, 1, 0, 0, 0), 8, 1, 2, 60_000, 3));
+            pred.Add(new WeatherInfo(new DateTime(2000, 1, 1, 3, 0, 0), 8, 1, 2, 60_000, 6));
+            pred.Add(new WeatherInfo(new DateTime(2000, 1, 1, 12, 0, 0), 8, 1, 2, 60_000, 6));
+            pred.Add(new WeatherInfo(new DateTime(2000, 1, 1, 18, 0, 0), 8, 1, 2, 60_000, 12));
+            pred.Add(new WeatherInfo(new DateTime(2000, 1, 2, 6, 0, 0), 8, 1, 2, 60_000, 3));
+            pred.Add(new WeatherInfo(new DateTime(2000, 1, 2, 9, 0, 0), 8, 1, 2, 60_000, 15));
+            pred.Add(new WeatherInfo(new DateTime(2000, 1, 3, 0, 0, 0), 8, 1, 2, 60_000, 3));
+
+            pred.Add(new WeatherInfo(new DateTime(2000, 1, 3, 3, 0, 0), 8, 1, 2, 60_000, 3));
+
+            target.Predictions = pred;
+
+            List<WeatherInfo> retVal = target.GetPredictionForTime(new DateTime(2000, 1, 1, 3, 0, 0), new DateTime(2000, 1, 1, 3, 0, 0));
+
+            Assert.AreEqual(1, retVal.Count);
+            Assert.AreEqual(new WeatherInfo(new DateTime(2000, 1, 1, 3, 0, 0), 8, 1, 2, 60_000, 6), retVal[0]);
+        }
+
         [TestMethod]
         public void GetPredictionForTimeFilter()
         {
@@ -466,6 +498,40 @@ namespace ServerAppFunctionalTests.ParserTests
             Assert.AreEqual(new WeatherInfo(new DateTime(2000, 1, 3, 0, 0, 0), 8, 1, 2, 60_000, 3), retVal[5]);
         }
 
+        [TestMethod]
+        public void GetPredictionForTimeFilterII()
+        {
+            string data = "";
+
+            Mock<IDataDownloader> dl = new Mock<IDataDownloader>();
+            dl.Setup(m => m.DownloadWeatherPrediction()).Returns(data);
+
+            Mock<IDataLoader> l = new Mock<IDataLoader>();
+
+            JsonParser target = new JsonParser(dl.Object, l.Object);
+
+            List<WeatherInfo> pred = new List<WeatherInfo>();
+            pred.Add(new WeatherInfo(new DateTime(2000, 1, 1, 0, 0, 0), 8, 1, 2, 60_000, 3));
+
+            pred.Add(new WeatherInfo(new DateTime(2000, 1, 1, 3, 0, 0), 8, 1, 2, 60_000, 6));
+            pred.Add(new WeatherInfo(new DateTime(2000, 1, 1, 12, 0, 0), 8, 1, 2, 60_000, 6));
+            pred.Add(new WeatherInfo(new DateTime(2000, 1, 1, 18, 0, 0), 8, 1, 2, 60_000, 12));
+            pred.Add(new WeatherInfo(new DateTime(2000, 1, 2, 6, 0, 0), 8, 1, 2, 60_000, 3));
+            pred.Add(new WeatherInfo(new DateTime(2000, 1, 2, 9, 0, 0), 8, 1, 2, 60_000, 15));
+            pred.Add(new WeatherInfo(new DateTime(2000, 1, 3, 0, 0, 0), 8, 1, 2, 60_000, 3));
+
+            pred.Add(new WeatherInfo(new DateTime(2000, 1, 3, 3, 0, 0), 8, 1, 2, 60_000, 3));
+
+            target.Predictions = pred;
+
+            List<WeatherInfo> retVal = target.GetPredictionForTime(new DateTime(2000, 1, 1, 6, 0, 0), new DateTime(2000, 1, 1, 18, 0, 0));
+
+            Assert.AreEqual(3, retVal.Count);
+            Assert.AreEqual(new WeatherInfo(new DateTime(2000, 1, 1, 3, 0, 0), 8, 1, 2, 60_000, 6), retVal[0]);
+            Assert.AreEqual(new WeatherInfo(new DateTime(2000, 1, 1, 12, 0, 0), 8, 1, 2, 60_000, 6), retVal[1]);
+            Assert.AreEqual(new WeatherInfo(new DateTime(2000, 1, 1, 18, 0, 0), 8, 1, 2, 60_000, 12), retVal[2]);
+        }
+
         [TestMethod]
         public void GetPredictionForTimeInvalidInput()
         {
