本文整理汇总了C#中System.DateTime.getNext方法的典型用法代码示例。如果您正苦于以下问题:C# DateTime.getNext方法的具体用法?C# DateTime.getNext怎么用?C# DateTime.getNext使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.DateTime
的用法示例。
在下文中一共展示了DateTime.getNext方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: getDataItemsArray
public static DataItem[] getDataItemsArray(TimeframeSymbol timeframe, DateTime startDate, DateTime endDate, List<AnalysisType> types)
{
DateTime minDate = startDate.CompareTo(endDate) < 0 ? startDate : endDate;
DateTime d = new DateTime(minDate.Ticks);
List<DataItem> items = new List<DataItem>();
while (d.CompareTo(endDate) <= 0)
{
var item = generateDataItem(d, types);
d = d.getNext(timeframe);
items.Add(item);
}
var array = items.ToArray();
array.AppendIndexNumbers();
return array;
}
示例2: next_W1_returns_proper_value_for_sunday
public void next_W1_returns_proper_value_for_sunday()
{
DateTime d = new DateTime(2016, 8, 14);
Assert.AreEqual(new DateTime(2016, 8, 21, 0, 0, 0), d.getNext(TimeframeSymbol.W1));
}
示例3: next_M5_returns_proper_value_for_weekend_value
public void next_M5_returns_proper_value_for_weekend_value()
{
DateTime d = new DateTime(2016, 8, 20, 16, 0, 0);
Assert.AreEqual(new DateTime(2016, 8, 22, 0, 0, 0), d.getNext(TimeframeSymbol.M5));
}
示例4: next_MN1_returns_proper_value_if_base_date_is_not_first_day_of_month
public void next_MN1_returns_proper_value_if_base_date_is_not_first_day_of_month()
{
DateTime baseDate = new DateTime(2016, 8, 10);
Assert.AreEqual(new DateTime(2016, 9, 1), baseDate.getNext(TimeframeSymbol.MN1));
}
示例5: next_M5_returns_proper_value_for_last_week_quotation
public void next_M5_returns_proper_value_for_last_week_quotation()
{
DateTime d = new DateTime(2016, 8, 19, 23, 55, 0);
Assert.AreEqual(new DateTime(2016, 8, 22, 0, 0, 0), d.getNext(TimeframeSymbol.M5));
}
示例6: next_M5_returns_proper_value_for_middle_hours_value
public void next_M5_returns_proper_value_for_middle_hours_value()
{
DateTime d = new DateTime(2016, 8, 17, 15, 3, 21);
Assert.AreEqual(new DateTime(2016, 8, 17, 15, 5, 0), d.getNext(TimeframeSymbol.M5));
}
示例7: next_M5_returns_proper_value_for_last_quotations_before_friday_christmas
public void next_M5_returns_proper_value_for_last_quotations_before_friday_christmas()
{
DateTime d = new DateTime(2015, 12, 24, 21, 0, 0);
Assert.AreEqual(new DateTime(2015, 12, 28, 0, 0, 0), d.getNext(TimeframeSymbol.M5));
}
示例8: next_M5_returns_proper_value_for_last_quotations_before_newYear
public void next_M5_returns_proper_value_for_last_quotations_before_newYear()
{
DateTime d = new DateTime(2014, 12, 31, 21, 0, 0);
Assert.AreEqual(new DateTime(2015, 1, 2, 0, 0, 0), d.getNext(TimeframeSymbol.M5));
}
示例9: next_H4_returns_proper_value_for_last_quotations_before_friday_newYear
public void next_H4_returns_proper_value_for_last_quotations_before_friday_newYear()
{
DateTime d = new DateTime(2015, 12, 31, 20, 0, 0);
Assert.AreEqual(new DateTime(2016, 1, 4, 0, 0, 0), d.getNext(TimeframeSymbol.H4));
}
示例10: next_M30_returns_proper_value_for_middle_week_value
public void next_M30_returns_proper_value_for_middle_week_value()
{
DateTime d = new DateTime(2016, 8, 17, 16, 0, 0);
Assert.AreEqual(new DateTime(2016, 8, 17, 16, 30, 0), d.getNext(TimeframeSymbol.M30));
}
示例11: next_H4_returns_proper_value_for_last_quotations_before_christmas
public void next_H4_returns_proper_value_for_last_quotations_before_christmas()
{
DateTime d = new DateTime(2014, 12, 24, 20, 0, 0);
Assert.AreEqual(new DateTime(2014, 12, 26, 0, 0, 0), d.getNext(TimeframeSymbol.H4));
}
示例12: next_D1_returns_proper_value_for_weekend
public void next_D1_returns_proper_value_for_weekend()
{
DateTime d = new DateTime(2016, 8, 14);
Assert.AreEqual(new DateTime(2016, 8, 15, 0, 0, 0), d.getNext(TimeframeSymbol.D1));
}
示例13: next_D1_returns_proper_value_for_middle_week_day
public void next_D1_returns_proper_value_for_middle_week_day()
{
DateTime d = new DateTime(2016, 8, 16);
Assert.AreEqual(new DateTime(2016, 8, 17, 0, 0, 0), d.getNext(TimeframeSymbol.D1));
}
示例14: next_D1_returns_proper_value_for_friday_newYear
public void next_D1_returns_proper_value_for_friday_newYear()
{
DateTime d = new DateTime(2015, 12, 31);
Assert.AreEqual(new DateTime(2016, 1, 4), d.getNext(TimeframeSymbol.D1));
}
示例15: next_D1_returns_proper_value_for_friday_christmas
public void next_D1_returns_proper_value_for_friday_christmas()
{
DateTime d = new DateTime(2015, 12, 24);
Assert.AreEqual(new DateTime(2015, 12, 28), d.getNext(TimeframeSymbol.D1));
}