using System;

namespace Valg.EVA.Skanning.ServicesModel.Internal.Validation
{
    public class FillPercentageRangeChecker
    {
        private readonly int lowerBound;
        private readonly int upperBound;

        public FillPercentageRangeChecker(int lowerBound, int upperBound)
        {
            this.lowerBound = lowerBound;
            this.upperBound = upperBound;

            if(lowerBound >= upperBound)
                throw new InvalidOperationException("LowerBound must be lower than UpperBound when checking fill percentage");
        }

        public bool IsInsideRange(int fillPercentageToCheck)
        {
            return fillPercentageToCheck >= lowerBound && fillPercentageToCheck <= upperBound;
        }
    }
}
