當前位置: 首頁>>代碼示例>>C#>>正文


C# DateTime.addTimeUnits方法代碼示例

本文整理匯總了C#中System.DateTime.addTimeUnits方法的典型用法代碼示例。如果您正苦於以下問題:C# DateTime.addTimeUnits方法的具體用法?C# DateTime.addTimeUnits怎麽用?C# DateTime.addTimeUnits使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在System.DateTime的用法示例。


在下文中一共展示了DateTime.addTimeUnits方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: addTimeUnits_D1_if_baseDate_is_Thursday_31December_and_one_day_is_to_be_subtracted

        public void addTimeUnits_D1_if_baseDate_is_Thursday_31December_and_one_day_is_to_be_subtracted()
        {
            DateTime d = new DateTime(2015, 12, 31);
            DateTime expected = new DateTime(2016, 1, 4);
            DateTime result = d.addTimeUnits(TimeframeSymbol.D1, 1);

            Assert.AreEqual(expected, result);
        }
開發者ID:mielk,項目名稱:waluty,代碼行數:8,代碼來源:HelperMethodsUnitTests.cs

示例2: addTimeUnits_D1_if_baseDate_is_Friday_29December_and_one_day_is_to_be_added

        public void addTimeUnits_D1_if_baseDate_is_Friday_29December_and_one_day_is_to_be_added()
        {
            DateTime d = new DateTime(2017, 12, 29);
            DateTime expected = new DateTime(2018, 1, 2);
            DateTime result = d.addTimeUnits(TimeframeSymbol.D1, 1);

            Assert.AreEqual(expected, result);
        }
開發者ID:mielk,項目名稱:waluty,代碼行數:8,代碼來源:HelperMethodsUnitTests.cs

示例3: addTimeUnits_D1_if_baseDate_is_Thursday_21December_and_two_days_are_to_be_added

        public void addTimeUnits_D1_if_baseDate_is_Thursday_21December_and_two_days_are_to_be_added()
        {
            DateTime d = new DateTime(2017, 12, 21);
            DateTime expected = new DateTime(2017, 12, 26);
            DateTime result = d.addTimeUnits(TimeframeSymbol.D1, 2);

            Assert.AreEqual(expected, result);
        }
開發者ID:mielk,項目名稱:waluty,代碼行數:8,代碼來源:HelperMethodsUnitTests.cs

示例4: addTimeUnits_H4_if_units_zero_the_same_date_is_returned

        public void addTimeUnits_H4_if_units_zero_the_same_date_is_returned()
        {
            DateTime d = new DateTime(2016, 4, 21, 12, 0, 0);
            DateTime expected = new DateTime(2016, 4, 21, 12, 0, 0);
            DateTime result = d.addTimeUnits(TimeframeSymbol.H4, 0);

            Assert.AreEqual(expected, result);
        }
開發者ID:mielk,項目名稱:waluty,代碼行數:8,代碼來源:HelperMethodsUnitTests.cs

示例5: addTimeUnits_H4_if_units_positive_with_week_break

        public void addTimeUnits_H4_if_units_positive_with_week_break()
        {
            DateTime d = new DateTime(2016, 8, 2, 8, 0, 0);
            DateTime expected = new DateTime(2016, 8, 12, 12, 0, 0);
            DateTime result = d.addTimeUnits(TimeframeSymbol.H4, 49);

            Assert.AreEqual(expected, result);
        }
開發者ID:mielk,項目名稱:waluty,代碼行數:8,代碼來源:HelperMethodsUnitTests.cs

示例6: addTimeUnits_D1_if_units_positive_with_few_new_year_breaks

        public void addTimeUnits_D1_if_units_positive_with_few_new_year_breaks()
        {
            DateTime d = new DateTime(2012, 1, 25);
            DateTime expected = new DateTime(2017, 8, 29);
            DateTime result = d.addTimeUnits(TimeframeSymbol.D1, 1451);

            Assert.AreEqual(expected, result);
        }
開發者ID:mielk,項目名稱:waluty,代碼行數:8,代碼來源:HelperMethodsUnitTests.cs

示例7: addTimeUnits_D1_if_baseDate_is_Tuesday_2January_and_one_day_is_to_be_subtracted

        public void addTimeUnits_D1_if_baseDate_is_Tuesday_2January_and_one_day_is_to_be_subtracted()
        {
            DateTime d = new DateTime(2018, 1, 2);
            DateTime expected = new DateTime(2017, 12, 29);
            DateTime result = d.addTimeUnits(TimeframeSymbol.D1, -1);

            Assert.AreEqual(expected, result);
        }
開發者ID:mielk,項目名稱:waluty,代碼行數:8,代碼來源:HelperMethodsUnitTests.cs

示例8: addTimeUnits_M15_if_units_positive_omit_newYear_after_skip_weekend

        public void addTimeUnits_M15_if_units_positive_omit_newYear_after_skip_weekend()
        {
            DateTime d = new DateTime(2017, 12, 29, 20, 0, 0);
            DateTime expected = new DateTime(2018, 1, 2, 4, 0, 0);
            DateTime result = d.addTimeUnits(TimeframeSymbol.M15, 32);

            Assert.AreEqual(expected, result);
        }
開發者ID:mielk,項目名稱:waluty,代碼行數:8,代碼來源:HelperMethodsUnitTests.cs

示例9: addTimeUnits_M15_if_units_negative_with_week_break

        public void addTimeUnits_M15_if_units_negative_with_week_break()
        {
            DateTime d = new DateTime(2016, 7, 26, 4, 0, 0);
            DateTime expected = new DateTime(2016, 7, 15, 4, 0, 0);
            DateTime result = d.addTimeUnits(TimeframeSymbol.M15, -672);

            Assert.AreEqual(expected, result);
        }
開發者ID:mielk,項目名稱:waluty,代碼行數:8,代碼來源:HelperMethodsUnitTests.cs

示例10: addTimeUnits_M15_if_units_negative_with_newYear_at_week

        public void addTimeUnits_M15_if_units_negative_with_newYear_at_week()
        {
            DateTime d = new DateTime(2015, 1, 6, 12, 0, 0);
            DateTime expected = new DateTime(2014, 12, 30, 4, 0, 0);
            DateTime result = d.addTimeUnits(TimeframeSymbol.M15, -405);

            Assert.AreEqual(expected, result);
        }
開發者ID:mielk,項目名稱:waluty,代碼行數:8,代碼來源:HelperMethodsUnitTests.cs

示例11: addTimeUnits_H4_if_units_negative_with_christmas_and_newYear

        public void addTimeUnits_H4_if_units_negative_with_christmas_and_newYear()
        {
            DateTime d = new DateTime(2015, 1, 7, 12, 0, 0);
            DateTime expected = new DateTime(2013, 12, 23, 12, 0, 0);
            DateTime result = d.addTimeUnits(TimeframeSymbol.H4, -1608);

            Assert.AreEqual(expected, result);
        }
開發者ID:mielk,項目名稱:waluty,代碼行數:8,代碼來源:HelperMethodsUnitTests.cs

示例12: addTimeUnits_D1_if_units_positive_with_week_break

        public void addTimeUnits_D1_if_units_positive_with_week_break()
        {
            DateTime d = new DateTime(2016, 1, 21);
            DateTime expected = new DateTime(2016, 8, 29);
            DateTime result = d.addTimeUnits(TimeframeSymbol.D1, 157);

            Assert.AreEqual(expected, result);
        }
開發者ID:mielk,項目名稱:waluty,代碼行數:8,代碼來源:HelperMethodsUnitTests.cs

示例13: if_units_zero_the_same_date_is_returned_for_d1

        public void if_units_zero_the_same_date_is_returned_for_d1()
        {
            DateTime d = new DateTime(2016, 4, 21);
            DateTime result = d.addTimeUnits(TimeframeSymbol.D1, 0);

            Assert.AreEqual(d, result);
        }
開發者ID:mielk,項目名稱:waluty,代碼行數:7,代碼來源:HelperMethodsUnitTests.cs

示例14: addTimeUnits_D1_if_units_positive_with_weekendChristmas

        public void addTimeUnits_D1_if_units_positive_with_weekendChristmas()
        {
            DateTime d = new DateTime(2016, 12, 22);
            DateTime expected = new DateTime(2016, 12, 30);
            DateTime result = d.addTimeUnits(TimeframeSymbol.D1, 6);

            Assert.AreEqual(expected, result);
        }
開發者ID:mielk,項目名稱:waluty,代碼行數:8,代碼來源:HelperMethodsUnitTests.cs

示例15: addTimeUnits_D1_if_units_positive_with_new_year_break_at_weekend

        public void addTimeUnits_D1_if_units_positive_with_new_year_break_at_weekend()
        {
            DateTime d = new DateTime(2016, 12, 28);
            DateTime expected = new DateTime(2017, 1, 3);
            DateTime result = d.addTimeUnits(TimeframeSymbol.D1, 4);

            Assert.AreEqual(expected, result);
        }
開發者ID:mielk,項目名稱:waluty,代碼行數:8,代碼來源:HelperMethodsUnitTests.cs


注:本文中的System.DateTime.addTimeUnits方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。