当前位置: 首页>>代码示例>>C#>>正文


C# DateTime.getNext方法代码示例

本文整理汇总了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;
        }
开发者ID:mielk,项目名称:waluty,代码行数:17,代码来源:UnitTestTools.cs

示例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));
 }
开发者ID:mielk,项目名称:waluty,代码行数:5,代码来源:HelperMethodsUnitTests.cs

示例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));
 }
开发者ID:mielk,项目名称:waluty,代码行数:5,代码来源:HelperMethodsUnitTests.cs

示例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));
 }
开发者ID:mielk,项目名称:waluty,代码行数:5,代码来源:HelperMethodsUnitTests.cs

示例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));
 }
开发者ID:mielk,项目名称:waluty,代码行数:5,代码来源:HelperMethodsUnitTests.cs

示例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));
 }
开发者ID:mielk,项目名称:waluty,代码行数:5,代码来源:HelperMethodsUnitTests.cs

示例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));
 }
开发者ID:mielk,项目名称:waluty,代码行数:5,代码来源:HelperMethodsUnitTests.cs

示例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));
 }
开发者ID:mielk,项目名称:waluty,代码行数:5,代码来源:HelperMethodsUnitTests.cs

示例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));
 }
开发者ID:mielk,项目名称:waluty,代码行数:5,代码来源:HelperMethodsUnitTests.cs

示例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));
 }
开发者ID:mielk,项目名称:waluty,代码行数:5,代码来源:HelperMethodsUnitTests.cs

示例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));
 }
开发者ID:mielk,项目名称:waluty,代码行数:5,代码来源:HelperMethodsUnitTests.cs

示例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));
 }
开发者ID:mielk,项目名称:waluty,代码行数:5,代码来源:HelperMethodsUnitTests.cs

示例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));
 }
开发者ID:mielk,项目名称:waluty,代码行数:5,代码来源:HelperMethodsUnitTests.cs

示例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));
 }
开发者ID:mielk,项目名称:waluty,代码行数:5,代码来源:HelperMethodsUnitTests.cs

示例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));
 }
开发者ID:mielk,项目名称:waluty,代码行数:5,代码来源:HelperMethodsUnitTests.cs


注:本文中的System.DateTime.getNext方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。