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()); }
public void FindMaxPeriodIndex_ThrowsAtOneElementCollection() { Assert.Throws(typeof(InvalidOperationException), () => Analysis.FindMaxPeriodIndex(new DateTime(2001, 1, 1))); }
public void FindMaxPeriodIndex_ThrowsAtEmptyCollection() { Assert.Throws(typeof(InvalidOperationException), () => Analysis.FindMaxPeriodIndex()); }