/// <summary> /// This function is responsible for executing one test on the <see cref="HandlerWaitTimeList"/> (queue). /// </summary> /// <param name="CycleTimeInmSeconds">The cycle time in seconds.</param> /// <param name="Autoreset">if set to <c>true</c> auto-reset feature is enabled.</param> /// <param name="OperationTimeInMiliseconds">The time in ms of each operation on the list.</param> /// <param name="testTimefSeconds">The consistency should be checked after this number of seconds.</param> /// <param name="CheckConsistencySyncronously">if set to <c>true</c> check consistency synchronously.</param> private void OneTest(int CycleTimeInmSeconds, bool Autoreset, int OperationTimeInMiliseconds, int testTimefSeconds, double acceptableErrorInPercents) { TimeSpan _Cycle = new TimeSpan(0, 0, 0, 0, CycleTimeInmSeconds); System.Console.WriteLine("Test with {0} ms long procedure, Auto-reset:{1} ", OperationTimeInMiliseconds, Autoreset); using (FacadeHandlerWaitTimeList myList = new FacadeHandlerWaitTimeList(_Cycle, Autoreset, OperationTimeInMiliseconds)) { WaitAndCheckConsistency(testTimefSeconds, myList, acceptableErrorInPercents); } }
/// <summary> /// Waits the and check consistency. /// </summary> /// <param name="ConsistencyCheckAfterNumberOfSeconds">The consistency check after number of seconds.</param> /// <param name="myList">My list.</param> private void WaitAndCheckConsistency(int ConsistencyCheckAfterNumberOfSeconds, FacadeHandlerWaitTimeList myList, double maxError) { Thread.Sleep(TimeSpan.FromSeconds(ConsistencyCheckAfterNumberOfSeconds)); Assert.IsTrue(myList.Consistency(maxError), "The list is not consistent)"); }