public DateTime GetLastDate()
{
if (IsEmpty) {
throw new NoValuesOnLineException();
}
return valuePoints.Max(x => x.Date);
}
public void shouldThrowWhenThereAreNoValuePoints() { ILine emptyline = new Line(); Assert.Throws<NoValuesOnLineException>(() => emptyline.GetValuePoints()); Assert.Throws<NoValuesOnLineException>(() => emptyline.GetValue(DateTime.Now)); Assert.Throws<NoValuesOnLineException>(() => emptyline.GetFirstDate()); Assert.Throws<NoValuesOnLineException>(() => emptyline.GetLastDate()); }