[TestCase(10, StrCacheLastUpdate, 2000, 5, true, 99, -1, 0)]                    // No wait time:  cacheReaderDelay < 0 ms
        public void WaitBeforeGettingNextImageTest_AnyParameters_ReturnExpectedResult(int cacheUpdaterUserId, string strCacheLastUpdate, int cacheLifeTime,
                                                                                      int cacheFps, bool cacheHasData,
                                                                                      int cacheReaderUserId, int cacheReaderDelay, int expectedWaitTimeMilliSec)
        {
            // Arrange
            DateTime cacheLastUpdate     = DateTime.ParseExact(s: strCacheLastUpdate, format: "yyyy-MM-dd HH:mm:ss.fff", provider: null);
            DateTime timeWhenCacheIsRead = cacheLastUpdate.AddMilliseconds(cacheReaderDelay);

            byte[] imageBytes = cacheHasData ? new byte[2] : null;

            CacheUpdateService imageCache       = CreateImageCache(imageBytes, cacheUpdaterUserId, cacheLastUpdate);
            var cachingService                  = new ImageFromCacheService(cacheUpdateService: imageCache, logger: null, cacheLifeTimeMilliSec: cacheLifeTime, framesPerSecond: cacheFps);
            int fpsTimeBetweenTwoFramesMilliSec = 1000 / cacheFps;

            // Act
            (int waitTimeMilliSec, string reason) = cachingService.WaitBeforeGettingNextImage(userId: cacheReaderUserId, timeRequested: timeWhenCacheIsRead);

            // Assert
            Assert.That(waitTimeMilliSec, Is.EqualTo(expectedWaitTimeMilliSec));

            Assert.That(waitTimeMilliSec, Is.LessThanOrEqualTo(fpsTimeBetweenTwoFramesMilliSec));
        }