Ejemplo n.º 1
0
        public void FindMaxPeriodIndex_ProcessDatesCorrectly(int expectedIndex, string[] dates)
        {
            var parsedDates = dates.Select(d => DateTime.ParseExact(d, "yyyy.MM.dd", CultureInfo.InvariantCulture)).ToArray();
            var actualIndex = Analysis.FindMaxPeriodIndex(parsedDates);

            Assert.AreEqual(expectedIndex, actualIndex);
        }
 public void ProcessDatesCorrectly()
 {
     Assert.AreEqual(
         2,
         Analysis.FindMaxPeriodIndex(
             new DateTime(2001, 1, 11),
             new DateTime(2001, 1, 12),
             new DateTime(2001, 1, 13),
             new DateTime(2001, 1, 20),
             new DateTime(2001, 1, 21)));
 }
 public void ThrowsAtOneElementCollection()
 {
     Assert.Throws(typeof(ArgumentException), () => Analysis.FindMaxPeriodIndex(new DateTime(2001, 1, 1)));
 }
 public void ThrowsAtEmptyCollection()
 {
     Assert.Throws(typeof(ArgumentException), () => Analysis.FindMaxPeriodIndex());
 }
Ejemplo n.º 5
0
 public void FindMaxPeriodIndex_ThrowsAtOneElementCollection()
 {
     Assert.Throws(typeof(InvalidOperationException), () => Analysis.FindMaxPeriodIndex(new DateTime(2001, 1, 1)));
 }
Ejemplo n.º 6
0
 public void FindMaxPeriodIndex_ThrowsAtEmptyCollection()
 {
     Assert.Throws(typeof(InvalidOperationException), () => Analysis.FindMaxPeriodIndex());
 }