AK.F1.Timing.Model.Driver.LapTimesModel.GetSector C# (CSharp) Method

GetSector() public method

Gets the sector time collection for the specified one-based sector number.
/// Thrown when is not positive or is greater than three. ///
public GetSector ( int sectorNumber ) : PostedTimeCollectionModel
sectorNumber int The one-based sector number.
return AK.F1.Timing.Model.Collections.PostedTimeCollectionModel
        public PostedTimeCollectionModel GetSector(int sectorNumber)
        {
            if(sectorNumber == 1)
            {
                return S1;
            }
            else if(sectorNumber == 2)
            {
                return S2;
            }
            else if(sectorNumber == 3)
            {
                return S3;
            }

            throw Guard.ArgumentOutOfRange("sectorNumber");
        }

Usage Example

        public void get_sector_throws_if_sector_number_is_not_positive_or_greater_than_three()
        {
            var model = new LapTimesModel();

            Assert.Throws<ArgumentOutOfRangeException>(() => model.GetSector(0));
            Assert.Throws<ArgumentOutOfRangeException>(() => model.GetSector(4));
        }
All Usage Examples Of AK.F1.Timing.Model.Driver.LapTimesModel::GetSector