Пример #1
0
 public void countTimeUnits_m30_returns_proper_value_for_date_few_days_later_after_weekend()
 {
     DateTime d1 = new DateTime(2016, 8, 12, 12, 0, 0);
     DateTime d2 = new DateTime(2016, 8, 16, 20, 0, 0);
     int result = d1.countTimeUnits(d2, TimeframeSymbol.M30);
     Assert.AreEqual(112, result);
 }
Пример #2
0
        public void countTimeUnits_weeks_if_comparedDate_from_previous_years_proper_value_is_returned()
        {
            DateTime d1 = new DateTime(2016, 4, 21);
            DateTime d2 = new DateTime(2015, 12, 5);
            int result = d1.countTimeUnits(d2, TimeframeSymbol.W1);

            Assert.AreEqual(-20, result);
        }
Пример #3
0
        public void countTimeUnits_weeks_if_second_date_not_first_date_of_week_rounded_value_is_used()
        {
            DateTime d1 = new DateTime(2016, 8, 1);
            DateTime d2 = new DateTime(2016, 8, 11);
            int result = d1.countTimeUnits(d2, TimeframeSymbol.W1);

            Assert.AreEqual(1, result);
        }
Пример #4
0
        public void countTimeUnits_months_if_earlier_date_proper_value_is_returned()
        {
            DateTime d1 = new DateTime(2016, 4, 1);
            DateTime d2 = new DateTime(2016, 4, 21);
            int result = d1.countTimeUnits(d2, TimeframeSymbol.MN1);

            Assert.AreEqual(0, result);
        }
Пример #5
0
        public void countTimeUnits_months_if_second_date_not_first_date_of_month_rounded_value_is_used()
        {
            DateTime d1 = new DateTime(2016, 4, 1);
            DateTime d2 = new DateTime(2016, 11, 16);
            int result = d1.countTimeUnits(d2, TimeframeSymbol.MN1);

            Assert.AreEqual(7, result);
        }
Пример #6
0
 public void countTimeUnits_m5_returns_proper_value_for_date_few_weekends_later()
 {
     DateTime d1 = new DateTime(2016, 8, 10, 16, 0, 0);
      DateTime d2 = new DateTime(2016, 8, 22, 12, 0, 0);
      int result = d1.countTimeUnits(d2, TimeframeSymbol.M5);
      Assert.AreEqual(2256, result);
 }
Пример #7
0
        public void countTimeUnits_months_if_both_dates_from_the_same_month_but_base_date_is_earlier_zero_is_returned()
        {
            DateTime d1 = new DateTime(2016, 4, 15);
            DateTime d2 = new DateTime(2016, 4, 30);
            int result = d1.countTimeUnits(d2, TimeframeSymbol.MN1);

            Assert.AreEqual(0, result);
        }
Пример #8
0
 public void countTimeUnits_m5_returns_proper_value_for_date_few_days_earlier_before_weekend()
 {
     DateTime d1 = new DateTime(2016, 8, 17, 12, 0, 0);
      DateTime d2 = new DateTime(2016, 8, 11, 12, 0, 0);
      int result = d1.countTimeUnits(d2, TimeframeSymbol.M5);
      Assert.AreEqual(-1152, result);
 }
Пример #9
0
 public void countTimeUnits_m5_returns_proper_value_for_date_few_days_earlier_before_weekend_and_before_christmas()
 {
     DateTime d1 = new DateTime(2015, 12, 29, 12, 0, 0);
      DateTime d2 = new DateTime(2015, 12, 24, 12, 0, 0);
      int result = d1.countTimeUnits(d2, TimeframeSymbol.M5);
      Assert.AreEqual(-541, result);
 }
Пример #10
0
 public void countTimeUnits_m30_returns_proper_value_for_date_two_weeks_earlier_with_dayOfWeek_earlier_than_base_date()
 {
     DateTime d1 = new DateTime(2016, 8, 19, 12, 0, 0);
     DateTime d2 = new DateTime(2016, 8, 3, 16, 0, 0);
     int result = d1.countTimeUnits(d2, TimeframeSymbol.M30);
     Assert.AreEqual(-568, result);
 }
Пример #11
0
 public void countTimeUnits_m5_if_date_in_the_same_range_is_given_zero_is_returned()
 {
     DateTime d1 = new DateTime(2016, 8, 11, 12, 0, 0);
      DateTime d2 = new DateTime(2016, 8, 11, 12, 1, 53);
      int result = d1.countTimeUnits(d2, TimeframeSymbol.M5);
      Assert.AreEqual(0, result);
 }
Пример #12
0
 public void countTimeUnits_m30_returns_proper_value_for_date_few_weekends_earlier()
 {
     DateTime d1 = new DateTime(2016, 8, 11, 12, 0, 0);
     DateTime d2 = new DateTime(2016, 7, 21, 16, 0, 0);
     int result = d1.countTimeUnits(d2, TimeframeSymbol.M30);
     Assert.AreEqual(-712, result);
 }
Пример #13
0
 public void countTimeUnits_m30_returns_proper_value_for_date_few_days_later_in_the_same_week_after_christmas()
 {
     DateTime d1 = new DateTime(2014, 12, 23, 12, 0, 0);
     DateTime d2 = new DateTime(2014, 12, 26, 16, 0, 0);
     int result = d1.countTimeUnits(d2, TimeframeSymbol.M30);
     Assert.AreEqual(99, result);
 }
Пример #14
0
 public void countTimeUnits_m30_returns_proper_value_for_date_few_days_later_after_weekend_and_after_newYear()
 {
     DateTime d1 = new DateTime(2014, 12, 30, 16, 0, 0);
     DateTime d2 = new DateTime(2015, 1, 6, 12, 0, 0);
     int result = d1.countTimeUnits(d2, TimeframeSymbol.M30);
     Assert.AreEqual(179, result);
 }
Пример #15
0
 public void countTimeUnits_m5_returns_proper_value_for_date_few_newYears_earlier()
 {
     DateTime d1 = new DateTime(2016, 12, 26, 16, 0, 0);
      DateTime d2 = new DateTime(2012, 10, 23, 16, 0, 0);
      int result = d1.countTimeUnits(d2, TimeframeSymbol.M5);
      Assert.AreEqual(-311048, result);
 }
Пример #16
0
 public void countTimeUnits_m5_returns_proper_value_for_date_few_days_earlier_before_weekend_and_before_newYear()
 {
     DateTime d1 = new DateTime(2014, 1, 2, 12, 0, 0);
      DateTime d2 = new DateTime(2013, 12, 27, 16, 0, 0);
      int result = d1.countTimeUnits(d2, TimeframeSymbol.M5);
      Assert.AreEqual(-781, result);
 }
Пример #17
0
 public void countTimeUnits_m5_returns_proper_value_for_date_few_newYears_later()
 {
     DateTime d1 = new DateTime(2013, 10, 15, 12, 0, 0);
      DateTime d2 = new DateTime(2016, 11, 11, 16, 0, 0);
      int result = d1.countTimeUnits(d2, TimeframeSymbol.M5);
      Assert.AreEqual(229374, result);
 }
Пример #18
0
 public void countTimeUnits_m5_returns_proper_value_for_date_few_days_earlier_in_the_same_week_before_christmas()
 {
     DateTime d1 = new DateTime(2014, 12, 26, 12, 0, 0);
      DateTime d2 = new DateTime(2014, 12, 24, 20, 0, 0);
      int result = d1.countTimeUnits(d2, TimeframeSymbol.M5);
      Assert.AreEqual(-157, result);
 }
Пример #19
0
 public void countTimeUnits_m5_returns_proper_value_for_date_two_weeks_later_with_dayOfWeek_later_than_base_date()
 {
     DateTime d1 = new DateTime(2016, 8, 10, 12, 0, 0);
      DateTime d2 = new DateTime(2016, 8, 25, 16, 0, 0);
      int result = d1.countTimeUnits(d2, TimeframeSymbol.M5);
      Assert.AreEqual(3216, result);
 }
Пример #20
0
 public void countTimeUnits_m5_returns_proper_value_for_date_few_days_earlier_in_the_same_week_before_new_year()
 {
     DateTime d1 = new DateTime(2015, 1, 2, 16, 0, 0);
      DateTime d2 = new DateTime(2014, 12, 31, 12, 0, 0);
      int result = d1.countTimeUnits(d2, TimeframeSymbol.M5);
      Assert.AreEqual(-301, result);
 }
Пример #21
0
        public void countTimeUnits_months_if_comparedDate_from_next_years_proper_value_is_returned()
        {
            DateTime d1 = new DateTime(2013, 7, 15);
            DateTime d2 = new DateTime(2016, 4, 21);
            int result = d1.countTimeUnits(d2, TimeframeSymbol.MN1);

            Assert.AreEqual(33, result);
        }
Пример #22
0
 public void countTimeUnits_m5_returns_proper_value_for_date_few_days_later_after_weekend_christmas()
 {
     DateTime d1 = new DateTime(2016, 12, 23, 12, 0, 0);
      DateTime d2 = new DateTime(2016, 12, 27, 16, 0, 0);
      int result = d1.countTimeUnits(d2, TimeframeSymbol.M5);
      Assert.AreEqual(624, result);
 }
Пример #23
0
        public void countTimeUnits_months_if_is_in_the_same_month_zero_is_returned()
        {
            DateTime d1 = new DateTime(2016, 4, 1);
            DateTime d2 = new DateTime(2016, 4, 21);
            int result = d1.countTimeUnits(d2, TimeframeSymbol.MN1);

            Assert.AreEqual(0, result);
        }
Пример #24
0
 public void countTimeUnits_m5_returns_proper_value_for_date_few_days_later_after_weekend_newYear()
 {
     DateTime d1 = new DateTime(2011, 12, 28, 12, 0, 0);
      DateTime d2 = new DateTime(2012, 1, 3, 16, 0, 0);
      int result = d1.countTimeUnits(d2, TimeframeSymbol.M5);
      Assert.AreEqual(1200, result);
 }
Пример #25
0
        public void countTimeUnits_weeks_if_both_dates_from_the_same_week_but_base_date_is_later_zero_is_returned()
        {
            DateTime d1 = new DateTime(2016, 4, 21);
            DateTime d2 = new DateTime(2016, 4, 19);
            int result = d1.countTimeUnits(d2, TimeframeSymbol.W1);

            Assert.AreEqual(0, result);
        }
Пример #26
0
 public void countTimeUnits_m5_returns_proper_value_for_date_few_days_later_in_the_same_week()
 {
     DateTime d1 = new DateTime(2016, 8, 10, 16, 0, 0);
      DateTime d2 = new DateTime(2016, 8, 12, 20, 0, 0);
      int result = d1.countTimeUnits(d2, TimeframeSymbol.M5);
      Assert.AreEqual(624, result);
 }
Пример #27
0
        public void countTimeUnits_weeks_if_later_date_proper_value_is_returned()
        {
            DateTime d1 = new DateTime(2016, 4, 1);
            DateTime d2 = new DateTime(2016, 8, 1);
            int result = d1.countTimeUnits(d2, TimeframeSymbol.W1);

            Assert.AreEqual(18, result);
        }
Пример #28
0
 public void countTimeUnits_m5_returns_proper_value_for_date_few_days_later_in_the_same_week_after_new_year()
 {
     DateTime d1 = new DateTime(2013, 12, 30, 16, 0, 0);
      DateTime d2 = new DateTime(2014, 1, 3, 12, 0, 0);
      int result = d1.countTimeUnits(d2, TimeframeSymbol.M5);
      Assert.AreEqual(781, result);
 }
Пример #29
0
        public void countTimeUnits_weeks_if_the_same_date_is_given_zero_is_returned()
        {
            DateTime d1 = new DateTime(2016, 4, 1);
            DateTime d2 = new DateTime(2016, 4, 1);
            int result = d1.countTimeUnits(d2, TimeframeSymbol.W1);

            Assert.AreEqual(0, result);
        }
Пример #30
0
 public void countTimeUnits_m30_returns_proper_value_for_date_few_days_earlier_before_weekend_christmas()
 {
     DateTime d1 = new DateTime(2016, 12, 26, 12, 0, 0);
     DateTime d2 = new DateTime(2016, 12, 23, 16, 0, 0);
     int result = d1.countTimeUnits(d2, TimeframeSymbol.M30);
     Assert.AreEqual(-40, result);
 }