Index: DamClients/DamLive/trunk/src/Deltares.DamLive.Tests/GeneralHelper.cs =================================================================== diff -u -r5721 -r5752 --- DamClients/DamLive/trunk/src/Deltares.DamLive.Tests/GeneralHelper.cs (.../GeneralHelper.cs) (revision 5721) +++ DamClients/DamLive/trunk/src/Deltares.DamLive.Tests/GeneralHelper.cs (.../GeneralHelper.cs) (revision 5752) @@ -19,6 +19,7 @@ // Stichting Deltares and remain full property of Stichting Deltares at all times. // All rights reserved. +using System; using System.Collections.Generic; using System.IO; using Deltares.Dam.Application.Live; @@ -112,4 +113,28 @@ Assert.Fail("The test failed. See the error log in the test output console for more info"); } } + + /// + /// Make timeserie shorter for testing: the first, the last and the middle entry are only used + /// + /// + private static void ShortenTimeSeries(TimeSerieCollection inputTimeSeries) // ToDo the: Currently not used, but keep for future use + { + if (inputTimeSeries?.Series[0] != null && inputTimeSeries.Series[0].Entries.Count > 3) + { + double entriesCount = inputTimeSeries.Series[0].Entries.Count; + var middleIndex = (int)Math.Round(entriesCount / 2); + foreach (TimeSerie serie in inputTimeSeries.Series) + { + for (int i = serie.Entries.Count - 2; i > 0; i--) + { + if (i != middleIndex) // keep the time entry in the middle of the serie + { + serie.Entries.RemoveAt(i); + } + } + } + } + } + } \ No newline at end of file