mirror of
https://dev.azure.com/TeilRad/sharee.bike%20App/_git/Code
synced 2025-04-20 12:06:29 +02:00
Version 3.0.362
This commit is contained in:
parent
cba4da9357
commit
4ff3307997
128 changed files with 3954 additions and 3193 deletions
24
TestFramework/DateTimeMocker.cs
Normal file
24
TestFramework/DateTimeMocker.cs
Normal file
|
@ -0,0 +1,24 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace TestTINKLib
|
||||
{
|
||||
public class DateTimeMocker
|
||||
{
|
||||
private static int m_iIndex;
|
||||
private static IList<DateTime> m_oDateTimeSeries;
|
||||
|
||||
public DateTimeMocker(IList<DateTime> p_oDateTimeSeries)
|
||||
{
|
||||
if (p_oDateTimeSeries.Count < 1)
|
||||
{
|
||||
throw new Exception("Can not initialize mock object. List must contain at least one date time.");
|
||||
}
|
||||
|
||||
m_iIndex = 0;
|
||||
m_oDateTimeSeries = p_oDateTimeSeries;
|
||||
}
|
||||
|
||||
public Func<DateTime> GetDateTime = () => m_oDateTimeSeries[m_iIndex < m_oDateTimeSeries.Count ? m_iIndex++ : m_iIndex = 0];
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue