CarbonFitness.BusinessLogic.UnitHistory.Line.GetLastDate C# (CSharp) Метод

GetLastDate() публичный Метод

public GetLastDate ( ) : System.DateTime
Результат System.DateTime
        public DateTime GetLastDate()
        {
            if (IsEmpty) {
                throw new NoValuesOnLineException();
            }
            return valuePoints.Max(x => x.Date);
        }

Usage Example

Пример #1
0
        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());
        }