AK.F1.Timing.Live.LiveDriver.GetLastSector C# (CSharp) Method

GetLastSector() public method

Gets the last sector time for the specified sector number.
/// Thrown when is zero or greater than three. ///
public GetLastSector ( int sectorNumber ) : PostedTime
sectorNumber int The one-based sector number.
return PostedTime
        public PostedTime GetLastSector(int sectorNumber)
        {
            Guard.InRange(IsValidSectorNumber(sectorNumber), "sectorNumber");

            return LastSectors[sectorNumber - 1];
        }

Usage Example

Example #1
0
        public void get_and_set_last_sector_time_throws_if_sector_number_is_out_of_range()
        {
            var driver = new LiveDriver(1);
            var time = new PostedTime(TimeSpan.Zero, PostedTimeType.Normal, 1);

            Assert.Throws<ArgumentOutOfRangeException>(() => driver.SetLastSector(0, time));
            Assert.Throws<ArgumentOutOfRangeException>(() => driver.SetLastSector(4, time));
            Assert.Throws<ArgumentOutOfRangeException>(() => driver.GetLastSector(0));
            Assert.Throws<ArgumentOutOfRangeException>(() => driver.GetLastSector(4));
        }
All Usage Examples Of AK.F1.Timing.Live.LiveDriver::GetLastSector